znalazłem nauczyciela w http://www.sencha.com/forum/showthread.php?198856-Ext.ux.TreeCombo
próbuję zrobić treecombo w Extjs4.1 w http://jsfiddle.net/rq2ha/ Oto mój kodJak pracować z treecombo w ExtJS 4,1
Ext.onReady(function() {
Ext.create('Ext.ux.TreeCombo', {
margin:10,
width:120,
height: 10,
treeHeight: 10,
treeWidth: 240,
renderTo: 'treecombo3',
store: storeMenu,
selectChildren: false,
canSelectFolders: true
,itemTreeClick: function(view, record, item, index, e, eOpts, treeCombo)
{
var id = record.data.id;
// I want to do something here.
// But combo do nothing (not selected item or not finish) when i init itemTreeClick function
}
});
});
1-te Problem: I chcę uzyskać id drzewa i zrobić coś Kiedy klikam element drzewa na combo. Ale kombinacja nie jest kompletna (seleted) kiedy klikam (combo nic nie robię).
2-ty Problem: jeśli zmienię sklep jest dynamiczna jak
var treestore = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'example.php',
reader: {
type: 'json'
}
},
autoload: true
});
będę się błąd
mój json
[ { id : '1' , text : 'a', iconCls: 'cls1' ,children :[{ id : '2' , text : 'b', iconCls: 'cls2' ,children :[{ id : '9' , text : 'a', iconCls: 'cls' ,children :[]},{ id : '14' , text : 'a', iconCls: 'c' ,children :[{ id : '33' , text : 'b', iconCls: 'cls' ,children :[{ id : '35' , text : 'a', iconCls: 'cls' ,children :[{ id : '36' , text : 'a', iconCls: 'cls' ,children :[]}]}]}]},{ id : '16' , text : 'd', iconCls: 'cls' ,leaf:true}]},...
Jak mogę naprawić podziękować
dzięki to działa :) – DeLe