May 19, 2012, 6:31 AM
[CLOSED] Some Issue with TreePanel Drag and Drop
Hi,
I have some issues with Tree Drag and Drop. I did not have them with v1.3. May be I am missing something here.
1) I have node.Leaf=true. And have set Allow LeafDrop=true. Despite this I am not able to drop a node on it.
2) If I have node.Leaf=false, I always see a plus sign on the left of Node even if there are no children. I have to explicitely set a expandable=false to remove the plus sign. And if I set expandable=false, even if I drop a node, it wont show the plus sign.
2) If I try to expand a node (After Drop, or if it has children), it throws an error, as its expecting some event on server. In earlier versions, it would never fire a server event until explicitly mentioned. Now it always shows a loading icon (1st time when a node is expanded). Notice this in the example here : https://examples1.ext.net/#/TreePane...Reorder_Nodes/
Expand any node, or Drop ay node on another. It will show a Loader 1st. I dont want that behaviour. I want to handle all events myself. How do I disable these default events?
Here's my code:
ASPX
I have some issues with Tree Drag and Drop. I did not have them with v1.3. May be I am missing something here.
1) I have node.Leaf=true. And have set Allow LeafDrop=true. Despite this I am not able to drop a node on it.
2) If I have node.Leaf=false, I always see a plus sign on the left of Node even if there are no children. I have to explicitely set a expandable=false to remove the plus sign. And if I set expandable=false, even if I drop a node, it wont show the plus sign.
2) If I try to expand a node (After Drop, or if it has children), it throws an error, as its expecting some event on server. In earlier versions, it would never fire a server event until explicitly mentioned. Now it always shows a loading icon (1st time when a node is expanded). Notice this in the example here : https://examples1.ext.net/#/TreePane...Reorder_Nodes/
Expand any node, or Drop ay node on another. It will show a Loader 1st. I dont want that behaviour. I want to handle all events myself. How do I disable these default events?
Here's my code:
ASPX
<ext:ResourceManager runat="server"></ext:ResourceManager>
<ext:TreePanel ID="sectionsTree" runat="server" RootVisible="false" Width="700" Height="800" AllowLeafDrop="true">
<View>
<ext:TreeView ID="TreeView1" runat="server" MultiSelect="true" >
<Plugins>
<ext:TreeViewDragDrop ID="TreeViewDragDrop1" runat="server" />
</Plugins>
</ext:TreeView>
</View>
</ext:TreePanel>
c#public partial class mapsections : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest) {
LoadTree(sectionsTree.Root);
}
}
public Ext.Net.NodeCollection LoadTree(Ext.Net.NodeCollection nodes)
{
if (nodes == null)
{
nodes = new Ext.Net.NodeCollection();
}
xmlStoreDbEntities db = new xmlStoreDbEntities();
Ext.Net.Node root = new Ext.Net.Node();
root.NodeID = "root";
root.Text = "No Sections Available";
root.Icon = Ext.Net.Icon.Blank;
nodes.Add(root);
for (int i = 0; i<100 ;i++)
{
Node n = new Node();
n.Text = "Node - " + i.ToString();
n.NodeID = i.ToString();
n.Leaf = true;
n.AllowDrop = true;
n.AllowDrag = true;
root.Children.Add(n);
//if (n.Children.Count == 0)
//{
// n.Expandable = false;
//}
}
return nodes;
}
}
Last edited by Daniil; May 23, 2012 at 8:40 PM.
Reason: [CLOSED]