Frage

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

War es hilfreich?

Lösung

'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' => ''
                    ),
                ),
         ),

Andere Tipps

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}',
),
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top