Hi Issam,
Thanks for contacting Syncfusion support
By using “refreshRow” public method we can refresh the specific row in TreeGrid.
We have prepared the work around and refreshed the newly added row by using refreshRow public method.
Please find the code example below:
function actionComplete(eventArgs) {
var treeObj = this,
//To get the index of newly added row
addedRow = treeObj.model.selectedItem;
if (eventArgs.requestType === 'addNewRow') {
//Newly Added Record is obtained here , which can be updated to database
var addedRecord = eventArgs.addedRow;
$.ajax({
type: "POST",
data: { Name: addedRecord.TaskName },
dataType: "json",
url: "/TreeGrid/Add",//Add is Server side method
success: function (result) {
addedRow.TaskId = addedRow.item.TaskId = result;
//To refresh the newly added row treeObj.refreshRow(treeObj.model.updatedRecords.indexOf(addedRow));
},
});
}
} |
We have prepared the sample based on your requirement. Please find the sample from below location
Regards,
Jone sherine P S