This tutorial will help you to hide the record delete button from CGridView if the record is used in other tables using relation concept.... Read More »
This tutorial will help you to hide the record delete button from CGridView if the record is used in other tables using relation concept.... Read More »
CSqlDataProvider implements a data provider based on a plain SQL statement. This tutorial will help you to display the custom sql query result into cgridview as normal crud view. ... Read More »
CButtonColumn used to renders one or more buttons in gridview columns. Basically cgridview column have three buttons. They are “view”, “update”, “delete” button and it have corresponding actions. We can change it using CButtonColumn properties.TemplateShow the button using template string using below format'template'=>'{view}{update}{delete}',We can add more buttons here.afterDeleteAfter deleted the row, We can do some action using afterDelete.deleteButtonImageUrlChange the delete button image url using deleteButtonImageUrldeleteButtonLabelChange the delete button label using […]... Read More »
In this article, I explained about Cgridview “CButtonColumn” of yii framework.Here I have added new button and assigned customized url to new button. We can change the url to “view”,”update”,”delete” button also. <?php $this->widget('zii.widgets.grid.CGridView', array( 'id'=>'user-grid', 'dataProvider'=>$model->search(), 'columns'=>array( 'username', 'type', array( 'class'=>'CButtonColumn', 'template'=>'{view}{update}{delete}{newbutton}', 'buttons'=>array( 'newbutton'=>array( 'label'=>'Click', 'url'=>'Yii::app()->createAbsoluteUrl('controller/action') )', 'visible'=>'$data["type"]=="admin"?false:true', ), ), ), ), ); ?>... Read More »
We can change the cgridview CButtonColumn visible status based on condition. Here i explained to show and hide the action buttons. using “visible” tag We can do this. To show the button set ‘true’ to visible and to hide the button set ‘false’ to visible. array( 'class'=>'CButtonColumn', 'header' => 'List of Actions', 'template'=>'{view}{update}{delete}{User}', 'buttons'=>array( 'User'=>array( 'lable'=>"User", 'url'=>'', 'visible'=>'$data["status"]==0?true:false', ), 'update'=>array( 'visible'=>'$data["status"]==0?true:false', ), 'delete'=>array( 'visible'=>'$data["status"]==0?true:false', ), ), ),... Read More »
CGridview Basic CGridview With User MethodsCGridview Css StyleCGridview CButtonColumnCGridview AjaxCGridview enableSortingImages In CGridviewLink In CGridviewCGridview Summary TextPagination Header Text And Override Pagination CSSEmpty Result TextCGridview After DeleteSupport FilesCGridview Pagination TextColumn Header In CGridviewRow Selection Or Click Event In CGridViewAdd Css Class To CGridView Table RowAdd Class Or Style For CGridView Header CellAdd Css Class To CGridView Table ColumnCGridview Filter : DropDown ListCGridView Filter: DatepickerCGridview BasicHint – For Html: When display the date, […]... Read More »