gpt4 book ai didi

mysql - 在ExtJS 4中,将树的节点和子节点保存到MySQL数据库中。关于ExtJS最简单的方法有什么想法吗?

转载 作者:行者123 更新时间:2023-11-30 23:31:41 26 4
gpt4 key购买 nike

var tree2 = Ext.create('Ext.tree.Panel', {
id: 'tree2',
title: 'Tree Hierarchy',
width: 250,
height: 100,
store: store2,
enableDD: true,
useArrows: true,
collapsible:true,
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop',
appendOnly: true
}
},
dockedItems: [{
xtype: 'toolbar',
items: [{
text: 'Expand All',
handler: function(){
tree2.expandAll();
}
}, {
text: 'Collapse All',
handler: function(){
tree2.collapseAll();
}
}]
}]

});


上面是渲染我正在使用的树的代码。

最佳答案

如果您使用过Json或数组存储(store2),则您具有Json数据。
因此,您可以保存Json数据并在每次需要时读取它。

您可以使用Sencha教程来做到这一点:
http://docs.sencha.com/ext-js/4-0/#!/guide/data

如果本教程的方法第一次有些复杂,则可以使用简单的Ajax调用来将Json数据读写到服务器:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.Ajax

关于mysql - 在ExtJS 4中,将树的节点和子节点保存到MySQL数据库中。关于ExtJS最简单的方法有什么想法吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10263656/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com