Aug 16, 2011, 5:42 AM
[CLOSED] Drag Drop problem in TreeGrid
Below is ma code..My onRemoteMove is activated.When the page is first time loaded and without expanding any of the Parent node,I drap drop Parent node to parent node(Node_1 To Node_2),the parent node being draged disappers.
When i expand the target node and then dragdrop the parent to parent it does not disappears..it works fine
When i expand the target node and then dragdrop the parent to parent it does not disappears..it works fine
<ext:TreeGrid ID="trptags" runat="server" Title="Family" Width="500" Height="300" Icon="Folder"
Region="Center" EnableDD="true"
Mode="Remote" OnRemoteMove="RemoteMove" AllowLeafDrop="true">
<Columns>
<ext:TreeGridColumn Header="Tag Name" Width="330" DataIndex="tagname" />
<ext:TreeGridColumn Header="Leaf Node" Width="100" DataIndex="ishidden" />
<ext:TreeGridColumn Header="Created On" Width="100" DataIndex="createdDate" />
</Columns>
<Loader>
<ext:PageTreeLoader OnNodeLoad="BindTagTree">
</ext:PageTreeLoader>
</Loader>
<Editors>
<ext:TreeEditor ID="TreeEditor1" runat="server" CancelOnBlur="true">
<Field>
<ext:TextField ID="TextField1" runat="server" />
</Field>
</ext:TreeEditor>
</Editors>
</ext:TreeGrid>
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
ResourceManager1.RegisterIcon(Ext.Net.Icon.Folder)
ResourceManager1.RegisterIcon(Ext.Net.Icon.TagYellow)
Dim realRoot As New Ext.Net.TreeNode()
realRoot.NodeID = "Root0"
realRoot.Expanded = True
Dim treeNode As New Ext.Net.AsyncTreeNode()
treeNode.Leaf = False
treeNode.Icon = Icon.Folder
treeNode.Expanded = True
treeNode.NodeID = "0_Parent"
treeNode.CustomAttributes.Add(New ConfigItem("tagname", "Root", ParameterMode.Value))
realRoot.Nodes.Add(treeNode)
trptags.Root.Add(realRoot)
End If
End Sub
Public Sub BindTagTree(ByVal sender As Object, ByVal e As NodeLoadEventArgs)
Dim tndCollection As New Ext.Net.TreeNodeCollection
For i As Integer = 1 To 2
Dim oNode As New Ext.Net.TreeNode
oNode.NodeID = "Node_" & i
oNode.Text = "Node_" & i
oNode.CustomAttributes.Add(New Ext.Net.ConfigItem("tagname", oNode.Text, ParameterMode.Value))
oNode.CustomAttributes.Add(New Ext.Net.ConfigItem("createdDate", Date.Now.ToString, ParameterMode.Value))
oNode.Icon = Icon.Folder
oNode.Nodes.AddRange(getTagNode1(i))
tndCollection.Add(oNode)
Next
e.Nodes.AddRange(tndCollection)
End Sub
Private Function getTagNode1(ByVal ParentID As String) As Ext.Net.TreeNodeCollection
Try
Dim tndCollection As New Ext.Net.TreeNodeCollection
For i As Integer = 1 To 2
Dim oNode As New Ext.Net.TreeNode
oNode.NodeID = "Leaf_" & i
oNode.Text = "Leaf_" & i
oNode.CustomAttributes.Add(New Ext.Net.ConfigItem("tagname", "Leaf_" & i, ParameterMode.Value))
oNode.CustomAttributes.Add(New Ext.Net.ConfigItem("ishidden", "True", ParameterMode.Value))
oNode.CustomAttributes.Add(New Ext.Net.ConfigItem("createdDate", Date.Now.ToString, ParameterMode.Value))
If i = 1 Then
oNode.Icon = Icon.TagYellow
oNode.Leaf = True
Else
oNode.Icon = Icon.Folder
oNode.Leaf = True
oNode.Listeners.Expand.Handler = "return false;"
End If
tndCollection.Add(oNode)
Next
Return tndCollection
Catch ex As Exception
LogError(ex, strPageName & "->getTagNode() ")
End Try
End Function
Protected Sub RemoteMove(ByVal sender As Object, ByVal e As RemoteMoveEventArgs)
e.Accept = True
End Sub
Thanx in advance
Last edited by geoffrey.mcgill; Aug 23, 2011 at 7:10 PM.
Reason: [CLOSED]