Suryacorner / flexigrid

Automatically exported from code.google.com/p/flexigrid
0 stars 0 forks source link

onSuccess() not waiting for AJAX #134

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
So if I want to manipulate the table after the AJAX call is made, there is no 
method I can use (I think).  If I need to select <tr> elements, I've got no way 
to hold a function until the AJAX has fired, that I'm aware of.

Original issue reported on code.google.com by cyborg10...@gmail.com on 25 Jul 2012 at 4:27

GoogleCodeExporter commented 8 years ago
Strange, onSuccess works fine for me, I've made a small change moving the "data 
= null" command after the callback call (and passing in to this function), so, 
after the ajax call, I can either pick some extra info (i pass more than page / 
total / rows on the ajax) and globally change the grid...

at bottom of addData() method:

tbody = null;               
i = null;
if (p.onSuccess) {
    p.onSuccess(this, data, p);
}
data = null;

and this is part of my code:

onSuccess: function(g, data, p) {
    info = data.info;
    $('td', g.bDiv).css('cssText', 'vertical-align: middle !important');
}

Original comment by harrypit...@gmail.com on 26 Jul 2012 at 1:36

GoogleCodeExporter commented 8 years ago
ah, I was calling an external function which wasn't working, if I move the 
function to onSuccess it works fine.

Original comment by cyborg10...@gmail.com on 26 Jul 2012 at 8:06