Hybrid View

  1. #1
    Ext User
    Join Date
    Jul 2007
    Posts
    24
    Vote Rating
    -1
    xiexueze has a little shameless behaviour in the past

      -1  

    Default [2.x] ComboBox Tree

    [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

  2. #2
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      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 Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  3. #3
    Ext User
    Join Date
    Jul 2007
    Posts
    24
    Vote Rating
    -1
    xiexueze has a little shameless behaviour in the past

      1  

    Default


    here are the pictures of the two examples
    Attached Images

  4. #4
    Sencha - Community Support Team jsakalos's Avatar
    Join Date
    Apr 2007
    Location
    Slovakia
    Posts
    27,538
    Vote Rating
    380
    jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future jsakalos has a brilliant future

      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 Search Plugin, ExtJS 5 Complex Data Binding using MVVM


  5. #5
    Ext User
    Join Date
    Apr 2007
    Posts
    36
    Vote Rating
    0
    Pagebaker is on a distinguished road

      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
    infinit is on a distinguished road

      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
    57258815 is on a distinguished road

      0  

    Default



  8. #8
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    [QUOTE=57258815;169624]

  9. #9
    Sencha User
    Join Date
    Jul 2011
    Posts
    1
    Vote Rating
    0
    misadecastro is on a distinguished road

      0  

    Default


    Very good!

  10. #10
    Sencha User
    Join Date
    Dec 2011
    Posts
    5
    Vote Rating
    0
    labafian is on a distinguished road

      0  

    Default


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