문제

I want to disable the update button from CGridView Table. I don't know how to do it. Just disable the update button, not delete the function of update. Anybody know how to do it? Thanks

enter image description here

도움이 되었습니까?

해결책

'columns' => array(
        // All your columns here
        // ...
        array(
            'template' => '{view}{delete}',
            'class' => 'CButtonColumn',
        ),
    ),

It's enough :)

EDIT: above solution removes the button. The following disable it (by removing the link):

'columns' => array(
        // All your columns here
        // ...
        array(
            'template' => '{view}{update}{delete}',
            'class' => 'CButtonColumn',
               'buttons' => array(
                   'update' => array(
                      'url' => ''
                    ),
                ),
         ),

다른 팁

You have to change the 'template' property of your CButtonColumn. The default value for 'template' is '{update}{view}{delete}'. So you have to do this:

array(
    'class' => 'CButtonColumn',
    'template' => '{view}{delete}',
),
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top