View Full Version : [CLOSED] Keep TreePanelīs selection after local sort

Jun 20, 2012, 2:25 PM
Hi folks, when a node is selected and then, a sort is performed, the selection is cleared.

Any idea to overcome this issue?

<ext:TreePanel ID="TreePanel2" SelType="Checkbox" runat="server" Title="Tree" Height="700"
Width="400" Margins="10" RootVisible="false" Border="false">
<ext:TreeStore ID="TreeStore1" runat="server">
<ext:AjaxProxy Url="/Example/LoadFakeChildren">
<ActionMethods Read="POST" />
<ext:JsonReader Root="data" />
<ext:Node NodeID="0" Text="Root" />
<ext:ModelField Name="Task" />
<ext:TreeColumn ID="TreeColumn1" runat="server" Text="Task" Flex="2" Sortable="true"
DataIndex="Task" />
<ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server"
Mode="Multi" />

public StoreResult LoadFakeChildren()
NodeCollection nodes = new NodeCollection(false);

for (int index = 1; index < 6; index++)
Node no = new Node();
no.NodeID = index.ToString() + DateTime.Now.Second;
no.CustomAttributes.Add(new ConfigItem { Name = "Task", Value = no.NodeID, Mode = ParameterMode.Value });

return new StoreResult { Data = nodes.ToJson() };

Jun 20, 2012, 8:05 PM

I am not 100% sure the CheckboxSelectionModel and RowSelectionModel can be used with TreePanel. But why not? At least, I can't see any restriction in the ExtJS docs.

And it works if set up

for the CheckboxSelectionModel.

See also

One doubt - it's marked as "private". I am not 100% sure there won't be any backside effects.

If you will face any troubles further, please report us.

Jun 23, 2012, 7:05 PM
it works like a charm. please mark it as resolved.