I have searched for a solution long time.
Can anyone show me a simple example?
To keep things simple, I want to add names to table.
I have working autocomplete field and an ajax button, which adds name to the database through ajax.
After request is completed, table update should be triggered.
Currently I have no idea, how to use CGridViews properties. What should be returned? I found an example how to trigger update manually and that part works:
Currently, grid widget creation looks like this:
Same code widget will be returned through ajax.
Can anyone show me a simple example?
To keep things simple, I want to add names to table.
I have working autocomplete field and an ajax button, which adds name to the database through ajax.
After request is completed, table update should be triggered.
Currently I have no idea, how to use CGridViews properties. What should be returned? I found an example how to trigger update manually and that part works:
'success' => 'js:function(){$.fn.yiiGridView.update("athletes_'.$contest->id.'")}'));
Currently, grid widget creation looks like this:
<?php $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider' => $athletes, 'ajaxUpdate' => 'contest_'.$contest->id, 'id' => 'athletes_'.$contest->id, 'ajaxUrl' => '/admin/contest/updateAthleteList/id/'.$contest->id,)); ?>
Same code widget will be returned through ajax.