Posted on 2009-09-01 18:18
Robert Su 閱讀(1481)
評論(0) 編輯 收藏
問題描述:
網(wǎng)上關(guān)于extjs的comboTree已經(jīng)層出不窮了
利用tpl顯示tree不是問題
關(guān)鍵是combo的顯示值
網(wǎng)上的例子多是
comboxWithTree.setValue(node.id);
但是這樣的顯示跟post值不一樣
tree1.on('click',function(node){
var Record = Ext.data.Record.create(
{name: 'id', mapping: 'id'},
{name: 'text', mapping: 'text'}
) ;
var t = new Record({
id: node.id,
text: node.text
}
)
comboxWithTree.getStore().add(t);
console.debug(comboxWithTree.getStore().data);
comboxWithTree.setValue(node.id);
comboxWithTree.collapse();
});