简体   繁体   中英

using Csqldataprovider CGridView and CButtonColumn (Yii Framework) dont appear

i have got a gridview using the Csqldataprovider but then unlike CAtiveDataProvider default cButton column doesnt appear i did write the custom code to it

array(
 'class'=>'zii.widgets.grid.CButtonColumn',
 'viewButtonUrl'=>'Yii::app()->createUrl("/Controllername/view",array("id"=>$data["mid"]))',

),

as well am not rendering $data["mid"] in the gridview

but yet browser renders

PHP notice Trying to get property of non-object ...yii\\framework\\base\\CComponent.php(612) : eval()'d code(1 )

can anyone tell me what am i missing

try something like this

array(
            'class'=>'CButtonColumn',
                    'buttons'=>array(
                        'delete'=>array(
                            'url'=>  'your/ url',
                        ),
                        'update'=>array(
                            'url'=> 'your/ url',
                        ),
                        'view'=>array(
                            'url'=>'your/ url',
                        ),
                    ),
        ),

try

array('header'=>'Modifies',

'headerHtmlOptions' => array('style' => 'background-color:#E4E7E8'),

'htmlOptions' => array('style' => 'width:55px'),

'class'=>'zii.widgets.grid.CButtonColumn',

'viewButtonUrl'=>'Yii::app()->createUrl("/account/view", array("id"=>$data["id"]))',

'updateButtonUrl'=>'Yii::app()->createUrl("/account/editDealer", array( "d789@_5%1%d" => $data["id"]))',

'deleteButtonUrl'=>'Yii::app()->createUrl("/account/deleteDealer", array("d!7_@371%d"=>$data["id"]))',
),

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM