What is the proper way to use the yiiGridView.update() function? and/or is there any documentation regarding the execution model? Here is a snippet that I found online that is a typical way to code an ajax update for a grid.
$('#item-grid a.submitable').live('click',function(){
$.fn.yiiGridView.update('item-grid', {
type:'POST',
url:$(this).attr('href'),
data: {'".Yii::app()->request->csrfTokenName."':'".Yii::app()->request->csrfToken."'},
success:function() {
$.fn.yiiGridView.update('item-grid');
}
});
return false;
})
As you can see there is an outer update() called via POST, but then there is an inner update() called with an implicit GET. Why is there a redundancy here? I was auditing my server logs , and it show a POST request and two GET requests. Removing the success clause, leaving only the outer update() call still produces the necessary AJAX requests from what I can tell…
$('#item-grid a.submitable').live('click',function(){
$.fn.yiiGridView.update('item-grid', {
type:'POST',
url:$(this).attr('href'),
data: {'".Yii::app()->request->csrfTokenName."':'".Yii::app()->request->csrfToken."'},
});
return false;
})
Thanks,
James