How to enable Editing in JavaScript TreeGrid ?
TreeGrid allows you to edit the single cell or an entire row at a time. You can enable this functionality by enabling allowEditing option in editSettings option.
$("#TreeGridContainer").ejTreeGrid({ editSettings: { allowEditing: true, }, //... });
When this option is enabled, you can change a static cell or a row into edit mode interactively in the following ways,
- Using edit button in the toolbar, you can change all the cells in a row to edit mode.
- When you double click on a cell or select ‘Edit’ option in the context menu, the respective cell will change to edit mode when editMode is set to “cellEditing” or that entire row of cells will change to edit mode when editMode is set to “rowEditing”.
Code snippet:
$("#TreeGridContainer").ejTreeGrid({ editSettings: { allowEditing: true, //To enable cell editing, set editMode to ‘cellEditing’. editMode: "rowEditing", }, //To enable context menu editing contextMenuSettings: { showContextMenu: true, contextMenuItems: ["edit"] }, //To enable toolbar editing toolbarSettings: { showToolbar: true, toolbarItems: [ ej.TreeGrid.ToolbarItems.Edit, ] }, });
Sample link
A sample for Treegrid editing is available in the following links
Conclusion
I hope you enjoyed learning about how t oenable Editing 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 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!