EasyUI Forum
September 13, 2025, 02:03:05 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: How to make the datagrid not automatic load data from the url that i assigned?  (Read 12031 times)
aswzen
Sr. Member
****
Posts: 287


Indonesian

aswzen
View Profile WWW Email
« on: September 22, 2014, 02:29:12 AM »

How to make the datagrid not load data from the url that i assigned?  Huh
because every i assign an url to datagrid, it will automatic load the data...

Quote
nb :
1. i don't want passing empty data to datagrid using .datagrid('loadData', {"total":0,"rows":[]})  in onLoadSuccess
2. i don't want to delete the data row by row like using .datagrid('deleteRow',{}) in onLoadSuccess
3. i don't want to assign the url in outline..or separated from the datagrid itself


i am sorry if i am missing something on documentation maybe...or it just my mistake..and
thanks in advance
« Last Edit: September 22, 2014, 02:32:39 AM by Agus Sigit Wisnubroto » Logged

Regards,
Sigit

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


View Profile Email
« Reply #1 on: September 22, 2014, 04:07:14 AM »

You can determine if to load the remote data by using the 'onBeforeLoad' event.
Code:
$('#dg').datagrid({
autoLoad:false,
onBeforeLoad:function(){
var opts = $(this).datagrid('options');
return opts.autoLoad;
}
});

If you want to load remote data, set the 'autoLoad' property to true and call 'reload' again.
Code:
$('#dg').datagrid('options').autoLoad = true;
$('#dg').datagrid('reload');
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!