nath-0
(Nathalie Chabert)
January 11, 2013, 10:30am
1
hello,
I am using
$.fn.yiiGridView.update("tprojets-grid", {data: $(this).serialize() })
But I would like to update the whole grid expect the first row.
How I can do that?
is it possible to do something after the grid has been updated complety ?
Nath
Keith
(Kburton)
January 11, 2013, 8:31pm
2
You can specify javascript callbacks in the beforeAjaxUpdate and afterAjaxUpdate properties. The afterAjaxUpdate callback is fired after the grid is updated with the new data.
nath-0
(Nathalie Chabert)
January 14, 2013, 10:33am
3
afterAjaxUpdate doesn’t work for my issue.
I extends my gridView. I add a row to create a new row and I would like to keep the value for the next insert.
I attach a exemple with what I am trying to do.
code of my submit boutton :
echo CHtml::ajaxSubmitButton('Ajouter', $this->getController()->createUrl('/TRapportsActivites/Create'), array(
'type' => 'POST',
'dataType' => 'json',
'data' => 'js:$("#TRapportsActivites").serialize()',
'success' => 'js:function(data){
if(data.resultat==="Ok"){
$("#msgError").html("");
$.fn.yiiGridView.update("tprojets-grid", {
data: $(this).serialize()
// success :function(data){alert($("#dateAdd").val()});
//
});
}else{
$("#msgError").empty();
$("#msgError").append(data.msg);
}
}',
));
nath-0
(Nathalie Chabert)
January 14, 2013, 10:49am
4
I find the solution :
$.fn.yiiGridView.update("tprojets-grid", {
data: $(this).serialize(),
complete: function(jqXHR, status) {
if (status=="success"){
$("#dateAdd").val(data.date);
}
}
});