Save Checked Values

Hi all,

Still struggling with a sort of old question. Insert checked values to new table.

I have three tables.

  1. student ( id, name,gender)

  2. subject ( id, name)

  3. allocation (id,student_id,subject_id)

I want to allocate students for subjects. I tried to use many to many relation, but it is difficult to handle many to many in yii. Therefore I used following method;

  1. Create grid with " student_id(hidden), subject_id(hidden), student name (searchable), student gender(searchable), subject name ( searchable), checkbox"

Succeed with above step, now I need to insert selected student_ids and activity_ids to table ‘allocation’ as new records.

I tried with several ways including dhtmlxgrid. But still not success.

It’s really appreciate if some one can help to do this task ( insert selected student_ids and activity_ids to table ‘allocation’ as new records).

This post uses checkboxes and CAdvancedArBehavior to display and edit the intermediary table.


Dear Matt,

Thanks for the quick reply.

I tried to use methods discussed in that post and CAdvancedArBehaviour.

It worked well also.

But I need to display more than one column ( in CAdvancedArBehaviour it’s only on column “name” ) and also i need to filter the records by search boxes in each columns ( in my example student name, subject name , gender).

Is there a way to do that?

Thank you again.