EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Opan Mustopah on January 09, 2015, 10:17:16 PM



Title: refresh row scrollview datagrid after edit row
Post by: Opan Mustopah on January 09, 2015, 10:17:16 PM
afternoon all,

ok title says all.

said i have a datagrid with view : scrollview and it have CRUD feature.
after save the data (or onAfterEdit)  i want to refresh or reload that current row without reload whole datagrid or at least reload current page without going back to top or or first page.

it is possible to do that?
many thanks for yours solution and answer


Title: Re: refresh row scrollview datagrid after edit row
Post by: stworthy on January 10, 2015, 03:50:09 AM
You can call 'refreshRow' or 'updateRow' methods to reload one single row without reloading the whole page. The code looks like this:
Code:
$('#dg').datagrid('updateRow', {
  index: 63,
  row:{
    name: 'new name value',
    salary: 2000
  }
});


Title: Re: refresh row scrollview datagrid after edit row
Post by: Opan Mustopah on January 10, 2015, 07:18:56 AM
many thanks stworthy for your replay,
but do you have an example using method 'refreshRow'?

because when i try that method it doesn't effect anything:

here is my best shoot:
Code:
$list_data.datagrid('refreshRow', rowIndex);

and i put that code on onAfterEdit event datagrid.



Title: Re: refresh row scrollview datagrid after edit row
Post by: stworthy on January 10, 2015, 05:53:10 PM
Please refer to the attached example 'test.html'.


Title: Re: refresh row scrollview datagrid after edit row
Post by: Opan Mustopah on January 10, 2015, 08:22:37 PM
ok i get it. so refreshRow method doesn't request data to server? just refresh local data on datagrid?