Hi, I’m pretty new to Yii, comming from PRADO.
I’ve been trying to develop a CRUD application, and I’m using ajax modal popups to edit create/update the data.
Everything is working fine, except when a new record is added and the gridview is updated. Instead opening the popup do update the record, it gets redirected to the update url.
Well, I do think that the problem is caused when CGridView gets updated, and do not create the jquery handlers for the grid update/delete buttons.
The code I’m using:
$this->widget('zii.widgets.grid.CGridView', array(
'id' => 'party-contact-grid',
...
'columns'=>array(
...
array
(
'class'=>'TbButtonColumn',
'template'=>'{edit}{delete}',
'buttons'=>array
(
'edit' => array
(
'icon'=>'edit',
'label'=>'edit',
'url'=> 'Yii::app()->createUrl("partyContact/update", array("id" => $data->party_contact_id))',
'options' => array('ajax'=>array('type' => 'post', 'url'=>'js:$(this).attr("href")', 'success'=> 'function(data) { $("#party-contact-container").html(data); $("#party-contact-dialog").modal(); }'),)
),
Thanks,
Jesse