You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public array $buttons;
the configuration for buttons. Each array element specifies a single button which has the following format:
'buttonID' => array(
'label'=>'...', // text label of the button
'url'=>'...', // a PHP expression for generating the URL of the button
'imageUrl'=>'...', // image URL of the button. If not set or false, a text link is used
'options'=>array(...), // HTML options for the button tag
'click'=>'...', // a JS function to be invoked when the button is clicked
'visible'=>'...', // a PHP expression for determining whether the button is visible
)
Like url and visible, imgUrl should also accept a PHP expression for the url (I'm not sure how to allow this while maintaining BC, i.e. be able to accept both an url and a PHP expression for computing it, but there's certainly a way).
My use case for this is the following:
I want to create a button column that only has a custom button which uses the default image normally used for the update button. In order to do so, I need access to the grid object.
Of course there are a number of ugly workarounds like using assetManager to pick the image from the location where the assets of CGridView are (but this wouldn't work or should be changed if we were using some custom subclass of CGridView).
But it's easy to imagine other use cases, such as a custom button whose icon may vary depending on some property of $data.
The text was updated successfully, but these errors were encountered:
http://www.yiiframework.com/doc/api/1.1/CButtonColumn#buttons-detail
Like
url
andvisible
,imgUrl
should also accept a PHP expression for the url (I'm not sure how to allow this while maintaining BC, i.e. be able to accept both an url and a PHP expression for computing it, but there's certainly a way).My use case for this is the following:
I want to create a button column that only has a custom button which uses the default image normally used for the
update
button. In order to do so, I need access to the grid object.Of course there are a number of ugly workarounds like using
assetManager
to pick the image from the location where the assets ofCGridView
are (but this wouldn't work or should be changed if we were using some custom subclass ofCGridView
).But it's easy to imagine other use cases, such as a custom button whose icon may vary depending on some property of
$data
.The text was updated successfully, but these errors were encountered: