Answer the question
In order to leave comments, you need to log in
How to hide if value is false in TbGridView?
I'm trying to hide a cell, if the value is different from true, then it is required not to form
$this->widget('bootstrap.widgets.TbGridView', array(
'id'=>'bs-scenario-grid',
'dataProvider'=> $dataProvider,
'columns' => array(
[
'name' => 'pub',
'value' => function( $data ) {
if ($data->pub == 1) {
return "true";
} else if($data->pub == 0) {
return "hidden";
}
}
],
)
$dataProvider = new CActiveDataProvider('RoomCat');
$this->render("admin", array('dataProvider' => $dataProvider));
Answer the question
In order to leave comments, you need to log in
Hide the table cell, this is something new))) if the value pub == 0 just return an empty string and that's it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question