Grid view with columns from multiple tables but unable to display image in the gridview

StackOverflow https://stackoverflow.com/questions/21184203

  •  29-09-2022
  •  | 
  •  

문제

cant display image in the gridview wherein this grid view with columns from multiple tables .. following is what i have done am using EImageColumn..... i dont no where am i wrong ...... can any one please guide me

gridview in model2

  tbl2 columns
 array('header'=>'Pimg', 'value'=>array(
        'class'=>'EImageColumn',
        'name' => 'pimg',   //name of column from tbl1 and model1
        'htmlOptions' => array('style' => 'width: 100px;'),

        )), 
   tbl3 columns

can any one please guide me

if i place the above code i get this error

**call_user_func_array() expects parameter 1 to be a valid callback, array must have exactly two members**
도움이 되었습니까?

해결책

The class,name and htmlOptions should not be in the value array, just like in http://www.yiiframework.com/extension/image-column/

array(
    'header'=>'Pimg', 
    'class'=>'EImageColumn',
    'name' => 'm1.pimg', //assuming the relation to model1 in model2 is named m1
    'htmlOptions' => array('style' => 'width: 100px;'),
    'value'=>'...',// if required
), 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top