)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Syncfusion Feedback

How to refresh a row without refreshing the data source

Platform: jQuery |
Control: ejTreeGrid |
Published Date: February 24, 2017 |
Last Revised Date: May 29, 2019

There may be an instance, where we need to refresh a specific row instead of refreshing the entire data source, and it is possible in TreeGrid using refreshRow method.

The below code snippet explains refreshing a specific row in TreeGrid with the changes in a column value using the row index.

<script>
function rowRefresh() {
//To get the value entered in TextBox
var textName = $('#refreshedTaskName').val(),
textIndex = $('#indexSelected').val(),
treeObj = $("#TreeGridContainer").data("ejTreeGrid"),
updatedRecords = treeObj.model.updatedRecords;
//To retrieve the required row from updated records
itemToUpdate = updatedRecords[textIndex];
if (itemToUpdate) {
//To refresh the required record
itemToUpdate.taskName = itemToUpdate.item.taskName = textName;
treeObj.refreshRow(textIndex);
}
else {
alert("Enter a valid Index");
}
}
</script>

Click here to find the sample for the above scenario.

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon