How to specify the default position for rows added using Toolbar and context menu actions in JavaScript TreeGrid?
In JavaScript TreeGrid, you can add new rows either by Toolbar or by Context Menu. You can set the position by using the rowPosition property for a newly added row. Following are the values for rowPosition property:
- top – New row is added at the top of all rows.
- bottom - New row is added at the bottom of all rows.
- aboveSelectedRow - New row is added above the selected row.
- belowSelectedRow - New row is added below the selected row.
Refer to the following code example.
JS
<body> <script type="text/javascript"> $(function () { $("#TreeGridContainer").ejTreeGrid({ //... editSettings:{ allowAdding:true, allowEditing:true, allowDeleting:true, editMode:"cellEditing", rowPosition:"aboveSelectedRow", }, </script> </body>
Sample Link:
You can find a demo sample in the following link, Sample
Conclusion
I hope you enjoyed learning about how to specify the default position for rows added using Toolbar and context menu actions in JavaScript TreeGrid.
You can refer to our JavaScript TreeGrid feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript TreeGrid example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!