Jun 13, 2012, 7:09 PM
Hi folks, i have a TreePanel with remote load and remote move. When i try to move a node into another that has not been loaded, an exception is throw inside updateIndexes function.
To reproduce the problem please do the following steps.
To reproduce the problem please do the following steps.
- Open root node
- Do not expand any other node
- Drag the last child int second
- Note that there is a timer while loading the children of a node. this reproduces the round trip to the database.
- The exception is not thrown if the target is loaded before moving a node into it
<ext:TreePanel ID="TreePanel2" runat="server" Title="Remote Move vs Remote Load" Height="700"
Width="400" Margins="10" Border="false" Mode="Remote" RemoteMoveUrl="/Example/MoveNode">
<Store>
<ext:TreeStore ID="TreeStore1" runat="server">
<Proxy>
<ext:AjaxProxy Url="/Example/LoadFakeChildren">
<ActionMethods Read="POST" />
<Reader>
<ext:JsonReader Root="data" />
</Reader>
</ext:AjaxProxy>
</Proxy>
</ext:TreeStore>
</Store>
<Root>
<ext:Node NodeID="0" Text="Root" />
</Root>
<Fields>
<ext:ModelField Name="Task" />
</Fields>
<ColumnModel>
<Columns>
<ext:TreeColumn ID="TreeColumn1" runat="server" Text="Task" Flex="2" Sortable="true"
DataIndex="Task" />
</Columns>
</ColumnModel>
<View>
<ext:TreeView runat="server" TrackOver="true">
<Plugins>
<ext:TreeViewDragDrop ID="TreeViewDragDrop1" AllowLeafDrop="true" runat="server" />
</Plugins>
</ext:TreeView>
</View>
</ext:TreePanel>
public ActionResult MoveNode(string[] ids, string targetId, string point)
{
object r = new { actionSuccess = true };
return Content(JSON.Serialize(r), "json/application");
}
public StoreResult LoadFakeChildren()
{
NodeCollection nodes = new NodeCollection(false);
Thread.Sleep(TimeSpan.FromSeconds(3));
for (int indice = 1; indice < 6; indice++)
{
Node no = new Node();
no.NodeID = indice + " " + DateTime.Now.Second;
no.CustomAttributes.Add(new ConfigItem { Name = "Task", Value = no.NodeID, Mode = ParameterMode.Value });
nodes.Add(no);
}
return new StoreResult { Data = nodes.ToJson() };
}
Last edited by Daniil; Jun 14, 2012 at 5:26 PM.
Reason: [CLOSED]