Results 1 to 10 of 32

Thread: [2.x] ComboBox Tree

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext User
    Join Date
    Jul 2007
    Posts
    24
    Vote Rating
    -1
      -1  

    Default [2.x] ComboBox Tree

    Hi all:

    here I have two examples about the comboBox, the first with a tree, the second with a panel, exactly with what you want

    First example:
    HTML Code:
    	
           var comboxWithTree = new Ext.form.ComboBox({
    		store:new Ext.data.SimpleStore({fields:[],data:[[]]}),
    		editable:false,
    		shadow:false,
    		mode: 'local',
    		triggerAction:'all',
    		maxHeight: 200,
    		tpl: '<tpl for="."><div style="height:200px"><div id="tree1"></div></div></tpl>',
    		selectedClass:'',
    		onSelect:Ext.emptyFn
    	});
    	var tree1 = new Ext.tree.TreePanel({
    		loader: new Tree.TreeLoader({dataUrl:'get-nodes.php'}),
    		border:false,
     		root:new Ext.tree.AsyncTreeNode({text: 'treeRoot',id:'0'})
      	});
      	tree1.on('click',function(node){
      		comboxWithTree.setValue(node.text);
      		comboxWithTree.collapse();
      	});
    	comboxWithTree.on('expand',function(){
    		tree1.render('tree1');
      	});
    	comboxWithTree.render('comboxWithTree');
    second example:
    HTML Code:
    	var comboxWithPanel = new Ext.form.ComboBox({
    		store:new Ext.data.SimpleStore({fields:[],data:[[]]}),
    		editable:false,
    		mode: 'local',
    		triggerAction:'all',
    		maxHeight: 200,
    		tpl: '<div style="height:200px"><div id="panel"></div></div>',
    		selectedClass:'',
    		onSelect:Ext.emptyFn
    	});
    	comboxWithPanel.render('comboxWithPanel');
    	var tree2 = new Ext.tree.TreePanel({
    		loader: new Ext.tree.DWRTreeLoader({dwrCall:Tmplt.getTmpltTree}),
    		border:false,
    		autoScroll:true,
    		root:new Ext.tree.AsyncTreeNode({text: 'root',id:'0'})
      	});
    	var border = new Ext.Panel({
    		title:'title',
    		layout:'fit',
    		border:false,
    		height :200,
    	    tbar:[{text:'ok1'},'-',new Ext.form.TextField({id: 'bb',width:60}),{text:'search1'}],
    		bbar:[{text:'ok2'},'-',new Ext.form.TextField({id: 'aa',width:60}),{text:'search2'}],
    		items: tree2
      	});
    	comboxWithPanel.on('expand',function(){
    		border.render('panel');
      	});
    	
    Attached Files Attached Files

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Any demo? Or a screenshot at least? Otherwise I don't know if it is "exactly what I want"
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  3. #3
    Ext User
    Join Date
    Jul 2007
    Posts
    24
    Vote Rating
    -1
      1  

    Default

    here are the pictures of the two examples
    Attached Images Attached Images

  4. #4
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,664
    Vote Rating
    403
      0  

    Default

    Thanks for pictures. Interesting. I have no immediate use for it but it's good to know that this extension exists and that we can use it when the situation comes.

    Thank you for your work.
    Jozef Sakalos, aka Saki

    Education, extensions and services for developers at new http://extjs.eu
    News: Grid MultiSearch Plugin, Grid MultiSort Plugin, Configuring ViewModel Hierarchy


  5. #5
    Ext User
    Join Date
    Apr 2007
    Posts
    36
    Vote Rating
    0
      0  

    Default

    Nice I'll need something like this in the near future, looks like it still needs some finetuning, but nice work!

  6. #6
    Ext User
    Join Date
    Feb 2008
    Posts
    19
    Vote Rating
    0
      0  

    Question

    Great, but how to set the params to submit ? e.g. I need to submit the selected category_id and category_name; and when loading data, the comboboxtree can be populated with the existing data?

    Appreicate for your help.

  7. #7
    Ext User
    Join Date
    Apr 2008
    Posts
    2
    Vote Rating
    0
      0  

    Default


  8. #8
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    [QUOTE=57258815;169624]

  9. #9
    Sencha User
    Join Date
    Jul 2011
    Posts
    1
    Vote Rating
    0
      0  

    Default

    Very good!

  10. #10
    Sencha User
    Join Date
    Dec 2011
    Posts
    5
    Vote Rating
    0
      0  

    Default

    i can't download,
    file not found on server
    plese fix this
    tnx

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •