我有一個Ext.tree.Panel它有一個TreeStore。這棵樹在一個標籤中。問題在於,當我的應用程序加載應用程序中使用的所有樹時,即使該商店位於autoLoad:false時,也會加載它們的數據。我怎樣才能防止樹上的自動加載?ExtJS 4 TreePanel autoload
Ext.define('...', {
extend:'Ext.container.Container',
alias:'widget.listcontainer',
layout: {
type: 'vbox',
align: 'stretch'
},
items: [
{
xtype: 'container',
html: "...",
border: 0
},
{
xtype: '...',
flex: 1,
bodyPadding: 5,
margin: '9 0 0 0'
}
]
});
Ext.define('...', {
extend:'Ext.data.TreeStore',
model: '...',
proxy: {
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
api: {
read : 'some url'
}
}
});
Ext.define('...', {
extend: 'Ext.tree.Panel',
alias: 'widget....',
id: '...',
title: '...',
height: 400,
collapsible: true,
useArrows: true,
rootVisible: false,
multiSelect: true,
singleExpand: true,
autoScroll: true,
store: '...',
columns: [...]
});
P.S.我發現如果我在樹上把rootVisible改成true,這個問題不會發生,但是它會顯示給根節點(我不想)。
請添加您的代碼。 –
如果不是自動加載並且root不可見,你想在treepanel中看到什麼?我認爲你必須在創建商店的地方添加代碼。你想要AJAX可加載的樹或其他東西? –
當然,我會在時間到的時候做一個tree.store.load(),但我不希望加載發生在應用程序加載時使用的每一棵樹上。 –