CGridView Filter doesn't work when you add more than one button to the CButtonColumn

Posted by era on Stack Overflow See other posts from Stack Overflow or by era
Published on 2012-06-05T11:14:26Z Indexed on 2012/06/05 16:40 UTC
Read the original article Hit count: 218

Filed under:
|

I have a CGridView as follows,

<?php $this->widget('zii.widgets.grid.CGridView', array(
'id'=>'order-grid',
'dataProvider'=>$model->search(),
'filter'=>$model,
'columns'=>array(
    'order_id',
    //'ordered_datetime',
    'customer_id',
    'status',
    //'delivery_address',
    array(
        'class'=>'CButtonColumn',
        'template' => '{view} {rollback} {receive}{pack} {dispatch}{delivered}',
        'htmlOptions'=>array('width'=>'250px'),
        'buttons'=>array(
            'receive'=>array(
                'id'=>'receive',
                'name'=>'receive',
                'url'=>'$this->grid->controller->createUrl("/shop/order/admin&received=true", array("id"=>$data->order_id,"asDialog"=>1,"gridId"=>$this->grid->id))',
                'type'=>'submit',
                'imageUrl'=>'/mdg/images/Receive1.png',
                'visible'=>'($data->status=="pending")?true:false;'
             ),
                             'rollback'=>array(
                'id'=>'rollback',
                'name'=>'rollback',
                'url'=>'$this->grid->controller->createUrl("/shop/order/admin&rollback=true", array("id"=>$data->order_id,"asDialog"=>1,"gridId"=>$this->grid->id))',
                'imageUrl'=>'/mdg/images/rollback.jpg',
                'visible'=>'($data->status=="pending")?false:true;'
             ),


        ),
    ),
),

)); ?>

And When I add one more button to the buttons array, the filter doesnt work. Any Idea why that is? It's Great if anyone can help.. Thanks!

© Stack Overflow or respective owner

Related posts about php

Related posts about yii