EasyUI Forum
May 17, 2024, 04:23:48 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: refresh row scrollview datagrid after edit row  (Read 12732 times)
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« 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
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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
  }
});
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #2 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.

Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: January 10, 2015, 05:53:10 PM »

Please refer to the attached example 'test.html'.
Logged
Opan Mustopah
Full Member
***
Posts: 164


Indonesia


View Profile Email
« Reply #4 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?
Logged

-- Bajak Otak --
*** Sorry for my bad english :3 ***
--JeasyUI version 1.4--
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!