0
트리 패널이있어서 선택한 항목을 아래쪽으로 추가하려고합니다. Extjs 트리가 트리 패널의 선택된 노드에 추가로 추가되지 않습니다.
는 "루트에 추가"를 클릭하면
, 그것은 노력하고 있습니다.하지만. 당신이 "선정에 추가"를 클릭하면, 그것은 작동하지 않습니다
Ext.application({
name: 'Fiddle',
launch: function() {
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [{
text: "detention",
leaf: true
}, {
text: "homework",
expanded: true,
children: [{
text: "book report",
leaf: true
}, {
text: "algebra",
leaf: true
}]
}, {
text: "buy lottery tickets",
leaf: true
}]
}
});
Ext.create('Ext.tree.Panel', {
//title: 'Simple Tree',
itemId: 'projectTree',
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop'
}
},
id: 'projectTree',
width: 200,
height: 500,
store: store,
renderTo: Ext.getBody(),
dockedItems: [{
xtype: 'toolbar',
dock: 'top',
items: [{
text: 'Add To Selected',
handler: function() {
var treeNode = Ext.getCmp('projectTree').getSelectionModel().getSelection()
treeNode.appendChild({
text: 'Child 4',
leaf: false
});
}
}, {
text: 'Add to root',
handler: function() {
var treeNode = Ext.getCmp('projectTree').getRootNode();
treeNode.appendChild({
text: 'Child 4',
leaf: false
});
}
}]
}],
});
}
});
무엇을 당신은 '효과가 없다'는 뜻인가요? 추적 출력을 추가하려고 시도 했습니까? – Thevs
@Thevs, 그것은 아이에게 덧붙여지지 않습니다, 내가 한 링크를보세요. – SexyMF