D
D
des1roer2015-05-21 08:22:21
Yii
des1roer, 2015-05-21 08:22:21

Yii multiple cgridview from model?

We need to make several cgridviews.
In the model I write (for one) something like the following

for($i = 1, $cnt = count($rows); $i < $cnt; $i++) //формируем столбцы
{
    $id[] = $rows[$i]['id'];
}
        $criteria->addInCondition('id', $id);

How to link a view and a model?
maybe obliquely explained
the point is that I want to form several tables (with my own footer).
and I want to display a different model->search for them. I don't know their number. I get data for id by request from the database

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
des1roer, 2015-05-21
@des1roer

you can also redefine the search () function in the model public function mysearch($fact_id, $ware_id)
in a view

for($i = 1, $cnt = count($rows); $i < $cnt; $i++) //формируем столбцы
{
      $this->widget('bootstrap.widgets.TbExtendedGridView', array(
        'filter'=>'false',
        'type'=>'striped bordered',
       'dataProvider' => $model->mysearch($rows[$i]['fact_id'],$rows[$i]['ware_id']),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question