update component after grid view is updated

Hi,

I want to update a component after my grid view is updated (e.g. after grid sorting, grid filtering…)

Have any idea how to do it?

Thanks

Hello. There’s an afterAjaxUpdate property in CGridView where you can put your javascript code or call your js function…

You may want to search in the forum and the wikis, there are nice examples.

I use this method on a guestbook, the listview of entries is refreshed after a submit


 echo CHtml::ajaxSubmitButton(Yii::t('site', 'submit'), $this->createUrl('page/guestbooksubmit'), array('update' => '#guestbook-guestbook-form', 'complete' => 'js:'$.fn.yiiListView.update("yw0")'));