当用户在我的树中选择一行或多行时,我想将行的 ID 设置到我的商店代理的 url 上。这是我当前的代码:
var treePanel = Ext.create('Ext.tree.Panel', {
id: 'tree-panel',
title: 'Taxonomy',
region:'west',
collapsible: true,
split: true,
multiSelect: true,
height:'100%',
width: '20%',
minWidth: 100,
rootVisible: false,
autoScroll: true,
store: store,
viewConfig: {
allowCopy: true,
plugins: {
ptype: 'treeviewdragdrop',
appendOnly: true,
ddGroup: 'selDD'
}
}
});
这是我设置“选择”事件的代码:
treePanel.getSelectionModel().on('select', function(selModel, record) {
var selectedNode = treePanel.getSelectionModel().getSelection();
if (multiSelect,true) {
treeID=selectedNode[0].data.id;
//if(treeID = 'null'){
store1.proxy.url='json/json.php?taxee_id=<?php echo $taxe_id;?>&id=' + selectedNode[0].data.id ;
store1.load();
}
else
{
store1.proxy.url='json/json.php?taxee_id=<?php echo $taxe_id;?>&id=' + selectedNode[0].data.id + '&id1='+ selectedNode[1].data.id ;
store1.load();
}
});