Построение дерева из xml файла
При загрузке данных из xml файла получаю бесконечную вложенность одной папки в другую. Подскажите в чем проблема.
![]() XML-файл <?xml version="1.0" encoding="iso-8859-1"?> <nodes> <node> <text>grid</text> <cls>folder</cls> <leaf>false</leaf> <expanded>true</expanded> <children> <text>transform-dom_v7.html</text> <description>Transformation d'une table ecrite avec balise html en table grid</description> <src>grid/transform-dom_v7.html</src> <cls>file</cls> <leaf>true</leaf> </children> <children> <text>grid-search_v1.html</text> <description>Table avec fonction Search depuis données au format json</description> <src>grid/grid-search_v1.html</src> <cls>file</cls> <leaf>true</leaf> </children> <children> <text>grid-search-mysql_v1.html</text> <description>Table avec</description> <src>grid/transform-dom_v7.html</src> <cls>file</cls> <leaf>true</leaf> </children> </node> </nodes> XMLTreeStore: Ext.define('MyApp.store.MyXmlTreeStore', { extend: 'Ext.data.TreeStore', constructor: function(cfg) { var me = this; cfg = cfg || {}; me.callParent([Ext.apply({ autoLoad: true, storeId: 'MyXmlTreeStore', root: { text: 'Ext JS', id: 'src', expanded: true }, proxy: { type: 'ajax', extraParams: { isXml: true }, url: 'tree.xml', reader: { type: 'xml', root: 'nodes', record: 'node' } } }, cfg)]); } }); TreePanel: Ext.define('MyApp.view.MyTreePanel', { extend: 'Ext.tree.Panel', height: 250, width: 214, title: 'My Tree Panel', store: 'MyXmlTreeStore', initComponent: function() { var me = this; Ext.applyIf(me, { viewConfig: { } }); me.callParent(arguments); } }); |
Часовой пояс GMT +3, время: 21:31. |