Many to Many
Rate Topic:
1 Votes

Hi,
This is one of the life savers.
Is it possible to extend this solution for cgridview?
I want to display more than one columns. And allow user to mark check boxes from filtered list.
Any help is highly appreciated.

At the outset, I want to stress that in this thread people have used checkbox list to choose data from the related table.That means that they are deaing with minimal set of records.

In the following implementation, I used gridview to pick the records. I also disabled pagination.
With pagination, I am finding difficult to get the things done.That means that it is useful in situations where
we have minimal set of relational records.

php echo $this->renderPartial('_form', array('model'=>$model,'member'=>$member));//$model and $member is carried to the view.

In the view we are placing the grid inside the form,the grid has checkbox column.when user checks the rows,
primary key values of member records are placed as a string inside a text field. For that we have registered a script.When we are submitting the form, string of ids is converted to array in controller.

At the outset, I want to stress that in this thread people have used checkbox list to choose data from the related table.That means that they are deaing with minimal set of records.

In the following implementation, I used gridview to pick the records. I also disabled pagination.
With pagination, I am finding difficult to get the things done.That means that it is useful in situations where
we have minimal set of relational records.

php echo $this->renderPartial('_form', array('model'=>$model,'member'=>$member));//$model and $member is carried to the view.

In the view we are placing the grid inside the form,the grid has checkbox column.when user checks the rows,
primary key values of member records are placed as a string inside a text field. For that we have registered a script.When we are submitting the form, string of ids is converted to array in controller.