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
{{ message }}
This repository has been archived by the owner on May 3, 2024. It is now read-only.
Is there some requirement why the EditableColumn doesn't use the "type" setting for e.g. formating some gridcolumn with 'type'=>'boolean' or some manual format?
I tried my own format setting e.g. type 'percentage' which isn't shown.
I looked into the code an saw that you call the parent::renderDataCellContent($row, $data); function only if you set 'value' of the column or if the you don't render a model.
And therefore the 'type' isn't used at all for model attribute data columns.
Why didn't you just call the renderDataCellContent every time and add something like this to your code:
This will always set the 'data-value' with the correct 'attribute' value in your link. Then you could use the 'type' CDataColumn rendering like in normal grids but still have the correct (not changed) value for your Editable Popup for editiing.
After 'success' you normally refresh the grid anyway and therefore get a correct formated output again or you have to do the formated output in javascript.
Ok in my case i also could set
'value' => 'CHtml::encode($data->vat_percentage."%")',
and set the following in the editable parameters
'htmlOptions' => array(
'data-value' => '$data->vat_percentage'
)
To get the same result but a simple 'type' => 'percentage' would be easier to code.
This is just a Idea.
Regards Horizons
The text was updated successfully, but these errors were encountered:
Is there some requirement why the EditableColumn doesn't use the "type" setting for e.g. formating some gridcolumn with 'type'=>'boolean' or some manual format?
I tried my own format setting e.g. type 'percentage' which isn't shown.
I looked into the code an saw that you call the parent::renderDataCellContent($row, $data); function only if you set 'value' of the column or if the you don't render a model.
And therefore the 'type' isn't used at all for model attribute data columns.
Why didn't you just call the renderDataCellContent every time and add something like this to your code:
$options['htmlOptions']['data-value'] = $data->getAttribute(empty($this->editable['attribute']) ? $this->name : $this->editable['attribute']);
This will always set the 'data-value' with the correct 'attribute' value in your link. Then you could use the 'type' CDataColumn rendering like in normal grids but still have the correct (not changed) value for your Editable Popup for editiing.
After 'success' you normally refresh the grid anyway and therefore get a correct formated output again or you have to do the formated output in javascript.
Ok in my case i also could set
'value' => 'CHtml::encode($data->vat_percentage."%")',
and set the following in the editable parameters
'htmlOptions' => array(
'data-value' => '$data->vat_percentage'
)
To get the same result but a simple 'type' => 'percentage' would be easier to code.
This is just a Idea.
Regards Horizons
The text was updated successfully, but these errors were encountered: