Yii booster: how to render a cgridview inside a relation table row?

天涯浪子 提交于 2019-12-08 09:48:11

问题


I'm using boostrap library on Yii via yii-booster

I've created a relation table view

The related view is a TbGriView itself

Vhen in a row i click on the link on the 'related' column, the row expands itself, and render a TbGridview inside it.

The problem is that the internal gridview cannot be sorte, paged or filtered, because each action on it causes that the entire container grid will empty

Note - external grid as a id of 'extenalgrid' - each internal grid has as id like 'internalgrid-$rowId' , so every internal grid as differnt id on div, table and table row elements. - the action called from "render related tabel" link is using renderPartial without the postProcess option. If i use potProcess, the row will be empty

So is it not possible to rendere a full working gridview/tbgridview into a related table ?


回答1:


Use different css classes for the filters, buttons and headers for the different tables. From the jquery.yiigridview.js file events are bound to selectors as $('#table-id .selector-class') so elements in your internal gridView still trigger the events bound to the external gridView. You also have to specify a different url for the internal gridView by setting it's ajaxUrl.



来源:https://stackoverflow.com/questions/14497501/yii-booster-how-to-render-a-cgridview-inside-a-relation-table-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!