Articles in this section
Category / Section

How to specify the default position for rows added using Toolbar and context menu actions in JavaScript TreeGrid?

1 min read

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:

  1. top – New row is added at the top of all rows.
  2. bottom - New row is added at the bottom of all rows.
  3. aboveSelectedRow - New row is added above the selected row.
  4. 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 forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied