Good morning everyone, I have a problem there is a good time, I tried several existing threads on the forum and nothing. In the listing of news, I would like to list in this column and pageslot pageslot, wanted to put a combo to filter populated with all pageslot. There were many unsuccessful attempts, here’s one:
It must be because of the relationship, which is my biggest problem here has segmentation_id news, however is pageslot_id news_publication where news_publication has news_id.
Well, the combo came out, but now the problem is the relationship mentioned in the first post, as would be the model according to the News DER I posted?
according to documentation in the model $News, did this way:
public function relations()
{
...
return array(
...
'newsPublications' => array(self::HAS_MANY, 'NewsPublication', 'news_id'),
'newsPageSlots'=>array(self::HAS_MANY,'NewsPageSlot','pageslot_id', 'through'=>'newsPublications'),
..
public function search()
{
...
$criteria=new CDbCriteria;
$criteria->with = array('user', 'segmentation', 'newsPublications', 'status', 'newsPageSlots');
...
$criteria->compare('pageslot_id', NewsPublication::model()->getPublicationNews( $this->id )->pageslot_id);
...
But when selecting an option from the combo, it sends the value, but the combo back with the initial value (empty) and not apply the filter on the grid.
Hey, it worked, but now I do not know how to send the value for the model selected in the filter. When I select a filter value in the combo loses value: