jQuery UI Widgets › Forums › TreeGrid › couldn't display parentDataField properly
This topic contains 3 replies, has 2 voices, and was last updated by Peter Stoev 12 years, 6 months ago.
-
Author
-
hierarchy:
{
keyDataField: { name: ‘child’ },
parentDataField: { name: ‘parent’ }
},addButton.click(function (event) {
if (!addButton.jqxButton(‘disabled’)) {
$(“#treeGrid”).jqxTreeGrid(‘expandRow’, rowKey);
// add new empty row.
$(“#treeGrid”).jqxTreeGrid(‘addRow’, newRowID, {‘child’:’2.8′,’parent’:[rowKey],’link’:0,’score’:0}, ‘last’, rowKey);// select the first row and clear the selection.
$(“#treeGrid”).jqxTreeGrid(‘clearSelection’);
$(“#treeGrid”).jqxTreeGrid(‘selectRow’, newRowID);
// edit the new row.
$(“#treeGrid”).jqxTreeGrid(‘beginRowEdit’, newRowID);
updateButtons(‘add’);
}
});It shows Child:2.8 Parent:[object Object] link:0 score:0 on the page.
Hi jzhong,
It is not possible to update a Parent Field when you add a Row in jqxTreeGrid. The Rows also do not have such thing as parentDataField. That is used only during the data biding.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comThanks for your feedback Peter.
I was thinking that there should be a way to set a ParentDataField since there is a way to set keyDataField.
But showing “[object Object]” at the parentField isn’t user friendly.
Is there a way to work around?
Hi jzhong,
When you call the “addRow” method, you actually add the new record as a child of existing record i.e its parentDataField is automatically updated by jqxTreeGrid.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.