0
<?php echo CHtml::beginForm('','post',array('id'=>'base-si-received-item-form'));?><?php 
$this->widget('zii.widgets.grid.CGridView', array(
    'id'=>'base-si-received-item-grid',
    'dataProvider'=>$searchModel->search(),
    //'filter'=>$searchModel,
    'columns'=>array(       
        array(
            'class'=>'CCheckBoxColumn',
            'id'=>'base-si-received-item-id',       
            'selectableRows'=>2, // multiple rows can be selected       
        ),      
        array(
            'name' => 'details.stockno',
            'header'=>'Stock No',
            'value' => '$data->details->stockno',
        ),
        array(
            'name' => 'details.details_description_search',
            'header'=>'Description',
            'value' => '$data->details->details_description_search',
        ),

私のモデル

public function relations() {
    // NOTE: you may need to adjust the relation name and the related
    // class name for the relations automatically generated below.      
    return array(
        'details' => array(self::BELONGS_TO, 'BaseRefSiDetails', 'details_id'),
    );
}

私はすでに多くのアプローチを試しましたが、どれも機能しません..必要なのは、別のモデルからのデータを表示することです。関係は、giiジェネレーターの助けを借りてすでに行われていますが、まだ結果が見つかりません.

4

0 に答える 0