Hi,
I have tree grid and I want to rename specified node not only by doublicking it, but as the result of clicking button "rename" placed on Ribbon or from the context menuy. That is why I need the possibility of triggering "edit" event. It's the same case like with toolbar button "edit" in treegrid. But i don't what to use toolbar feature.
Thank you.
[JS]
<body>
<button onclick="rename()">Rename</button>
<div id="TreeGridContainer" style="width: 100%; height: 450px;"></div>
$("#TreeGridContainer").ejTreeGrid({
dataSource: sampleData,
//..
contextMenuSettings: {
showContextMenu: true,
contextMenuItems: ["add", "edit", "delete"]
},
})
<script>
function rename() {
$("#TreeGridContainer").ejTreeGrid('model.selectedRowIndex', 2); // Select the row to edit.
var treeObj = $("#TreeGridContainer").ejTreeGrid('instance');
treeObj.cellEdit(2, 'taskName'); // Public method to make any cell to editable state - cellEdit(rowIndex,headerText).
//$('#TreeGridContainertaskName').val('change');
//treeObj.saveCell(); // Public method to save any edited cell.
}
</script>
</body> |