I am trying to load the tree data on demand using the read and sending down id, hasChildren, and expanded - since I want to expand the root initially. Only the root node has the expanded value true, all others have it false.
My data source is:
and the first JSON response from the server is:
and this is the root item and is properly expanded in the tree view - properly reflecting the "Expanded":true.
the second JSON response from the server is (truncated for brevity):
Note that the first item in this JSON object ("OPExxxxxx - Ixx") is shown with the "Expanded":false, but in the treeview it is displayed as expanded.
...and there are about 26 total AJAX requests that load the tree (all with "Expanded":false). Is there anything here that would indicate why we are expanding each node and therefore loading all children?
One odd thing to note is that the plus/minus of all nodes including the root are in the "+" state even though all nodes are expanded. When I click the plus/minus to collapse a node, it remains "+" and when I click it again to expand it, it changes to "-". Not sure that sheds any light on the issue, but thought it was odd and perhaps useful.
Thanks,
--Ed
My data source is:
dataSource: new kendo.data.HierarchicalDataSource({ transport: { read: { url: '/WidgetJson/OrgTree', type: 'POST', dataType: 'json', data: function (currentParams) { var params = {}; params['includeCardAccounts'] = true; return params; } } }, schema: { model: { id: 'OrgId', hasChildren: 'HasChildren', expanded: 'Expanded' } }}),dataTextField: 'OrgDescription'and the first JSON response from the server is:
[{"OrgId":46431736,"OrgDescription":"XYZ DEPT Company","HasChildren":true,"Expanded":true}]the second JSON response from the server is (truncated for brevity):
[{"OrgId":46431761,"OrgDescription":"OPExxxxxx - Ixx","HasChildren":true,"Expanded":false},{"OrgId":46431760,"OrgDescription":"OS xxxxxx IBA","HasChildren":true,"Expanded":false},{"OrgId":46431759,"OrgDescription":"ODSxxxxxx- IBx","HasChildren":true,"Expanded":false}]...and there are about 26 total AJAX requests that load the tree (all with "Expanded":false). Is there anything here that would indicate why we are expanding each node and therefore loading all children?
One odd thing to note is that the plus/minus of all nodes including the root are in the "+" state even though all nodes are expanded. When I click the plus/minus to collapse a node, it remains "+" and when I click it again to expand it, it changes to "-". Not sure that sheds any light on the issue, but thought it was odd and perhaps useful.
Thanks,
--Ed