Adding new items will be done by setting a new/changed datamodel:
var treegridObj = $(this.parentContentId).data("ejTreeGrid");
// To refresh TreeGrid with new datasource
treegridObj.setModel({"dataSource" :data });
I have added a little sample with my problems with the scrollOffset method.
1) It would be nice if i set the selection to an item and the scrolling would be done automatically. (onlySelectRow button in the sample).
2) selectAndScroll button in the sample works for the rowIndex 12. For rows at the end of the treegrid(i think 28-36) scrolling doesn't work (e.g. change "12" in sample by "30")
I have to do a workaround by scroll to bottom and after that i can use the scrollOffset method
3) onlyScrollToBottom button doesn't work if allowPaging is set to true in the treeGrid configuration(change "allowPaging: false," to "allowPaging: true," in the sample)
4) scrollOffset not correct if some nodes are collapsed => use the sample with rowIndex 12 => collapse the first node ("Planning") and push the selectAndScroll button => the correct row would be selected, but the scrolling was not correct (the selection is not in the visible part of the treegrid)
Is there a possibility to get the index of an item/row only of the visible rows => in this sample with rowIndex=12 and the "Planning" node is collapsed it would be rowIndex=8
For number 1 and 2 i have a workaround. Number 3 i doesn't need currently. But number 4 is currently my high priority problem.
Do you have a workaround/solution for my problem number 4?
Greetings
Mike
Attachment:
EssentialStudioforJavaScript_TreeGrid_2f50f7b2.zip