Describe the bug
if the dataset has no field called "id" then the tree expand/collapse icon does not work, even if the data is correctly structured as parent/child hierarchy.
To Reproduce
var temp1 = [
{
"escalated": 2,
"depth": 1,
"expanded": true,
"taskName": "Follow up action with HMM Global",
"desc": "",
"comments": null,
"orderDate": "2015-01-08T05:00:00.000Z",
"time": "",
"children": [
{
"escalated": 1,
"depth": 2,
"taskName": "Quotes due to expire",
"desc": "Update pending quotes and send out again to customers.",
"comments": 3,
"orderDate": "2015-08-03T04:00:00.000Z",
"time": "7:10 AM"
},
{
"escalated": 0,
"depth": 2,
"taskName": "Follow up action with Universal Shipping Logistics Customers",
"desc": "Contact sales representative with the updated purchase order.",
"comments": 2,
"orderDate": "2014-07-03T04:00:00.000Z",
"time": "9:10 AM"
},
{
"escalated": 0,
"depth": 2,
"taskName": "Follow up action with Acme Trucking",
"desc": "Contact sales representative with the updated purchase order.",
"comments": 2,
"orderDate": "2015-04-04T04:00:00.000Z",
"time": "14:10 PM"
}
]
}
];
var columns = [];
columns.push({ id: 'taskName', name: 'Task', field: 'taskName', expanded: 'expanded', formatter: Formatters.Tree});
//columns.push({ id: 'id', name: 'Id', field: 'id'});
columns.push({ id: 'desc', name: 'Description', field: 'desc'});
columns.push({ id: 'comments', name: 'Comments', field: 'comments', formatter: Formatters.Hyperlink});
columns.push({ id: 'time', name: 'Time', field: 'time'});
$('#datagrid').datagrid({
columns: columns,
dataset: temp1,
treeGrid: true,
toolbar: {title: 'Tasks (Hierarchical)', results: true, personalize: true, actions: true, rowHeight: true}
});
Error
The tree icon changes but the child rows don't hide/show.
Expected behavior
The tree icon collapse the tree to show only one row
Version
v4.12.1
Platform
Screen shot

The JSON included in copied from the datagrid data in "http://usalvwaldevd16:4000/components/datagrid/example-tree.html". I removed the other rows of data just to keep one parent and 3 child rows, then take the "id" field out.
The reason I report this is that it took me a long while to figure out why my grid does not behave --- I make sense to require the dataset to have an "id" field if you want to edit the data and post back, but it should be affect the "showing". The tree node expand/collapse should always work with/without the id field.
I think that the ID is need for it to function correctly. Whats the objection to having one?
The older version (4.3) doe not have this requirement, so it definitely can function without it. When we upgraded to 4.12 I scratch my head so hard (already bald)...
I think we had to change it to use id to make some functionality work better, can track it down with more investigation. But at least there鈥檚 a workaround 馃憤
How about throw an exception when there is no "id" field in the dataset? Also put the requirement of "id" field in the example and documentation.
Yeah to reduce the lead time on this i think..
But i'd go with the workaround as might be a while before we can get to this one. Unless you would like to contribute a PR?
What is a PR? I had it working in my system by supplying ids.
PR = Pull Request - meaning you have a fix to submit in our code.
https://help.github.com/articles/about-pull-requests/
Fixed with other issue #405
Added this to the sprint because deepak addressed this so we can test it out.
http://localhost:4000/components/datagrid/test-tree-update-row.html
Tested along with issue #405 , passed QA testing on all browsers.