Jun 19, 2012, 8:45 PM
[CLOSED] Raising ItemMove when reordering a node into not loaded node
Hi folks, i have already had some problems when reordering a node, described in the following thread: http://forums.ext.net/showthread.php...t%B4s-children
and after testing it better a found another issue.
Take a look in the following structure:
if sub 1 is moved into root 2, which is not loaded/expanded yet, the ItemMove event is not raised.
I need that this event is raised because i need to refresh the order column, shown in my TreePanel (not in this sample).
and after testing it better a found another issue.
Take a look in the following structure:
- root 1
- sub 1
- sub 2
- sub 3
- root 2
- root 3
if sub 1 is moved into root 2, which is not loaded/expanded yet, the ItemMove event is not raised.
I need that this event is raised because i need to refresh the order column, shown in my TreePanel (not in this sample).
<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 ID="TreeView1" runat="server" TrackOver="true">
<Plugins>
<ext:TreeViewDragDrop ID="TreeViewDragDrop1" AllowLeafDrop="true" runat="server" />
</Plugins>
</ext:TreeView>
</View>
<Listeners>
<ItemMove Handler="def()" />
</Listeners>
</ext:TreePanel>
<script type="text/javascript">
var def = function () {
alert('def');
}
</script>
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);
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 });
nodes.Add(no);
}
return new StoreResult { Data = nodes.ToJson() };
}
Last edited by Daniil; Jun 20, 2012 at 7:36 PM.
Reason: [CLOSED]