Cgridview Append From Ajax Response

hello

Is there any sophisticated way to insert a CGridView into the content after an ajax response

I have a page with no CGridView just some button

If I push a button, this does an ajax request, where the response is a CGridView widget

I would like insert the response to the page

but in the page there was no cgridview javascripts before, so I can see the gridview but the pager/header links are not working (just links)

Is there any easy way to run javascripts after the ajax response?

thanks

in ajax response you can renderPartial your gridview and set processOutput to true

for example:




$this->renderPartial('gridView',array('model'=>$model,),false,true);



thanks

  • I have to set manually unique id to the gridview, because in the ajax response the automatic id number start from zero