-
1 Attachment(s)
[CLOSED] TreePanel Issue
Hi,
How to deal with the following issue, when there is no child node and the TreePanel RootVisible property is set to false, we are getting the request failure error message.
Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TreeTest.aspx.cs" Inherits="Web.Inventory.TreeTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script runat="server" type="text/javascript">
protected void Page_Load(object sender, EventArgs e)
{
this.LoadCategoryTreePanel(TreePanel1.Root);
}
private NodeCollection LoadCategoryTreePanel(NodeCollection nodes)
{
if (nodes == null)
{
nodes = new NodeCollection();
}
Node root = new Node();
root.Text = "Category";
root.Leaf = false;
nodes.Add(root);
Node n;
//for (int i = 0; i < 4; i++)
//{
// n = new Node();
// n.Text = "Node" + i;
// root.Children.Add(n);
//}
return nodes;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<div>
<ext:TreePanel Region="West" FrameHeader="false" Icon="ChartOrganisation" ID="TreePanel1"
RootVisible="False" MarginSpec="5 5 5 5" runat="server" Height="300" Width="250">
</ext:TreePanel>
</div>
</form>
</body>
</html>
-
Hi,
Please set up
Code:
<Store>
<ext:TreeStore runat="server" AutoLoad="false" />
</Store>
for the TreePanel.