EasyUI Forum
September 14, 2025, 03:11:39 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: Datagrid loading/loaded method do not work on IE and chrome.  (Read 9864 times)
citos
Newbie
*
Posts: 5


View Profile
« on: October 18, 2015, 11:52:13 PM »

In UI view, user will choose some filter condition and execute a search action.
I use a datagrid component to show the query result.
I use loadData metod to refresh table view. (because I add some status flag in ajax response excepting "total" and "rows")
I tested with Firefox 41.0.2, IE11 , chrome 45.0.2454.93 m, in window 7.
I found Datagrid loading/loaded method work on FF but do not work on IE and chrome.
Not sure if it's an issue. Any comments on it ?

Here is code snapshot:
   $("#"+tableId).datagrid("loading");//work on FF but no effect on IE and chrome
   var myDataType="text";
   var ajax_url="controller.php";
   sendAjaxRequest(ajaxData,ajax_url,myDataType,
      function(JSONobj){//this is AJAX succeed callback function, JSONobj contains these fields: result, rows, total.
         var code = JSONobj.result.code;
         var msg = JSONobj.result.msg;   
         if(code!="000"){
            $.messager.alert("Message",msg,"warning");
            return;
         }
         var total = JSONobj.total;
         if(total == 0){
            $.messager.alert("Search Result","No result found.","info");      
         }      
         $("#"+tableId).datagrid('loadData',JSONobj);      
         $("#"+tableId).datagrid("loaded");//work on FF but no effect on IE and chrome
      }
   );   
« Last Edit: October 18, 2015, 11:56:42 PM by citos » Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: October 19, 2015, 01:09:41 AM »

Please refer to http://jsfiddle.net/0Lh6acae/
Logged
citos
Newbie
*
Posts: 5


View Profile
« Reply #2 on: October 19, 2015, 02:14:32 AM »

thx,stworthy. So it should be that in my case, the datagrid loading time is too short to see in chrome and IE.
Logged
Sapphire
Newbie
*
Posts: 8


View Profile
« Reply #3 on: October 19, 2015, 05:42:56 AM »

Hello citos,

maybe its the problem that chrome and ie don't allow load local json files with ajax.

Do you load your files from a local file system or via web server?

You can start chrome with a special parameter to allow loading local json files.
(--allow-file-access-from-files or --disable-web-security)

http://stackoverflow.com/questions/19902538/loading-local-files-with-javascript-without-a-web-server
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!