Jul 21, 2011, 11:00 PM
[CLOSED] TreePanel : "invalid property id" error
Hello,
We are using DirectMethod to load nodes of TreePanel from database:
AddNodes create node this way:
invalid property id
[{,children:[{id:"1",iconCls:"icon-app...pplication",text:"JV",EntityType:1}]}]
Note, that there is no 'NodeId' property in JSON, but 'id' instead and that's exactly what error description says.
Do you see anything wrong with populating tree and passing it back to client through JSON in our case?
Much appreciated your help!
We are using DirectMethod to load nodes of TreePanel from database:
[DirectMethod]
public string LoadTree()
{
Ext.Net.TreeNodeCollection nodes = new Ext.Net.TreeNodeCollection();
Ext.Net.TreeNode root = new Ext.Net.TreeNode("Root");
nodes.Add(root);
List<VW_ORG_STRUCTURE> orgTree = OrgStructureDb.GetAllItems();
//recursevly add all nodes under the root starting with first level (i.e. PARENT_LIST_ITEM_ID == null)
AddNodes(root, orgTree.Where(t => t.PARENT_ID == null).ToList(), orgTree);
return nodes.ToJson();
}
AddNodes create node this way:
// Create the new node.
Ext.Net.TreeNode childNode = new Ext.Net.TreeNode(li.ENTITY_ID.ToString(), li.ENTITY_NAME, Icon.Application);
//the line below is just to test if using NodeID property explicitly resolves the problem - it didn't
childNode.NodeID = li.ENTITY_ID.ToString();
childNode.CustomAttributes.Add(new ConfigItem("EntityType", li.ENTITY_TYPE_ID.ToString()));
parent.Nodes.Add(childNode);
On the client we have this error (taken from FireBug):invalid property id
[{,children:[{id:"1",iconCls:"icon-app...pplication",text:"JV",EntityType:1}]}]
Note, that there is no 'NodeId' property in JSON, but 'id' instead and that's exactly what error description says.
Do you see anything wrong with populating tree and passing it back to client through JSON in our case?
Much appreciated your help!
Last edited by Daniil; Aug 02, 2011 at 1:56 PM.
Reason: Please use [CODE] tags, [CLOSED]