EasyUI Forum
April 20, 2024, 04:29:39 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: succes updating datagrid, timing reload problem  (Read 7034 times)
Spike
Newbie
*
Posts: 22


View Profile
« on: December 03, 2014, 04:28:13 AM »


Hello,

I have a small problem with timing the reload (refresh) of a Datagrid;
The URL in the $Ajax call updates the data in the MYSQL database

Everything is working fine but the grid reload is sometimes "refreshed" BEFORE the URL has done it's job.
 
How can I do the "reload" of the grid after I am sure the update of the URL php script has done it's work?
(when I do a refresh manually after 2 seconds the grid refreshes perfect....)

Thanx in advance,

Spike

   function valideer_factuur(){
      var row = $('#dg').datagrid('getSelected');
      if (row){

         $.ajax({
            url : 'factuur_valideren.php?id='+row.id',  // THIS UPDATES DATA BELONGING TO GRID
            
            success: function(data) {
               $.messager.alert('VALIDEREN ','NR :  '+row.id+' <br> VALIDEREN SUCCES ');
               $('#dg_hvs').datagrid('reload');   // reload the grid and data
            }
      });
         
                     
      }
   }
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!