EasyUI Forum
September 14, 2025, 01:08:20 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: onLoadSuccess always triggered when something happened to datagrid? [UNSOLVED]  (Read 7282 times)
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« on: March 07, 2016, 09:47:15 PM »

onLoadSuccess always triggered when something happened to datagrid, for example like
- sorting
- updating row
- etc

so is there any events listener to datagrid that called only one time when the datagrid loaded?

onLoadAtOnce() maybe or something?

Thank you in advance
Logged

Regards,
Sigit

- Indonesian jEasyUI Facebook page : https://www.facebook.com/groups/jeasyuiid/
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: March 08, 2016, 01:11:34 AM »

Calling 'updateRow' method to update a row does not trigger the 'onLoadSuccess' event. When sorting the datagrid, the data will be sorted and re-loaded into the datagrid, the 'onLoadSuccess' event fires. You can use the 'onBeforeSortColumn' event to set a sorting flag that indicates the loading type.
Code:
$('#dg').datagrid({
remoteSort: false,
onBeforeSortColumn: function(){
$(this).datagrid('options').sorting = true;
},
onLoadSuccess: function(){
var opts = $(this).datagrid('options');
if (!opts.sorting){
console.log('normal loaded')
}
opts.sorting = false;
}
})
Logged
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!