PDA

View Full Version : [CLOSED] Remove moving a node VS loading targetīs children.



RCN
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.


Open root node
Do not expand any other node
Drag the last child int second


4361

4362


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() };
}

Vladimir
Jun 13, 2012, 10:54 PM
Fixed in SVN
Please update and retest

RCN
Jun 14, 2012, 11:40 AM
Vladmir, a problem was introduced. when i try to move up or down - as brother - the node disappear

RCN
Jun 14, 2012, 12:13 PM
could you check this issue out?

Daniil
Jun 14, 2012, 2:55 PM
Thanks for the report. Fixed in SVN, revision #4094.

Please update and re-test.

RCN
Jun 14, 2012, 5:11 PM
Thank you, please mark it as closed.