我有一个主页面并像这样加载我的treepanel。(它没有问题加载)
TreeStore1.DataSource = FillTree.TreeDoldur();
TreeStore1.DataBind();
这是用户控制器, 添加数据后,我再次绑定treewiewstore
Ext.Net.TreeStore tw = (Ext.Net.TreeStore)Page.FindControl("TreeStore1");
tw.DataSource = FillTree.TreeDoldur();
tw.DataBind();
但是看来Treepanel会再次使用新值填充。如何解决这个问题。 (主页内的M treepanle)
这是标记
<ext:TreePanel ID="TreePanel1" runat="server" Title="TreePanel" Width="300" Height="200"
Margin="10" RootVisible="false" Lines="false" UseArrows="false" Region="West">
<TopBar>
<ext:Toolbar ID="Toolbar2" runat="server">
<Items>
<ext:ToolbarTextItem ID="ToolbarTextItem1" runat="server" Text="Filter:" />
<ext:ToolbarSpacer />
<ext:TriggerField ID="TriggerField1" runat="server" AutoFocus="true" EnableKeyEvents="true">
<Triggers>
<ext:FieldTrigger Icon="Clear" />
</Triggers>
<Listeners>
<KeyUp Fn="filterTree" Buffer="250" />
<TriggerClick Handler="clearFilter();" />
</Listeners>
</ext:TriggerField>
</Items>
</ext:Toolbar>
</TopBar>
<Store>
<ext:TreeStore ID="TreeStore1" runat="server">
<Root>
<ext:Node Expanded="true">
</ext:Node>
</Root>
</ext:TreeStore>
</Store>
<DirectEvents>
<ItemClick OnEvent="Hello">
<ExtraParams>
<ext:Parameter Name="Id" Value="record.data.id" Mode="Raw"></ext:Parameter>
</ExtraParams>
</ItemClick>
</DirectEvents>
<%-- <Listeners>
<ItemClick Handler="App.direct.Hello(record.data.id);" />
</Listeners>--%>
</ext:TreePanel>