SMART datagrid v.1 > Examples

Back  Forward

TreeView Editing  Example
no-lite

Like Grid View, the user can directly append or delete the rows or use the editor to edit the cell value in Tree View. First, just like the grid, the related properties should be specified as true in editOptions

If insertable is true, you can move Focus to the row location in which will insert and append a new row and type insert key to display the input row and start to append the row. 

Insert and append a row. The default value is false

 

Code -1
    tree.onInserting = function (grid, rowIndex) {
        if (!$('#chkInsertable').is(':checked')) return false;
    };

If type shift+insert keys, it will start to append from the next location of the row rather than the location of the selected row. And, if type ctrl+insert keys, it will start to append a row after the last child row of the selected row. 

Tree - 1
rows

If appendable is true, you can start to append a row with pressing down key in the last row of the tree. 

Append a row after the last row. The default value is false

If deletable is true, you can press ctrl+del keys and delete the selected rows. 

Delete the selected rows. The default value is false

The key input of expanding and collapsing rows is similar to a standard tree UI. It operates in the first column cell of the row by left and right keys. However, since SMART datagrid tree view is a tree which has the column, and the cell should be moved when press the right key in the first cell, you should press ctr+right keys to expand the row. 

View Source JSP 

See Also
GridBase.deleteSelection
TreeDataSet.addRow
TreeDataSet.insertRow
TreeDataSet.updateRow
TreeDataSet.deleteRow
Tree Overview
Examples
Tree Data Set