Reputation: 2347
Trying to update the contents of my grid view after an ajax call to an action that triggers some DB changes:
$.ajax({
'url': '" . $this->createUrl('//myController/myAction') . "',
'type': 'post',
'data': serial,
'success': $.fn.yiiGridView.update('my-grid'),
}
});
My problem is that the grid update ajax call seems to be called before my ajax call is completed so although the grid values are updated in the db the changes can only be seen after I manually refresh the page.
Upvotes: 1
Views: 5538
Reputation: 8587
You need to wrap that call in a function:
'success': function(){ $.fn.yiiGridView.update('my-grid'); }
Upvotes: 4