June 18, 2011

Enable In-place Editing in Yii Grid

Today someone asked me for help to integrate Jeditable with Yii CGridView. So I thought why not write a little tutorial that can help others as well. In this article I assume that you are comfortable working with Yii; you […]
April 12, 2011

Replace text box with drop down list in filter of CGridView

By default, Yii displays a textbox to search (filter) within results/records displayed by CGridView. In order to change those textboxes to drop down list (combo boxes), all you need to do is to assign an array to "filter" property of […]
April 9, 2011

Add conditions in search for relational tables

Let’s discuss example relationship given on following URL http://www.yiiframework.com/doc/guide/1.1/en/database.arr If you want to be able to filter results in grid using Posts’ author name then modify the search function of  Post model to similar to the one given below.
April 6, 2011

Change CGridView CSS file for entire application

To use your custom css file globally, set the cssfile property in config file   'components'=>array( 'widgetFactory'=>array( 'widgets' => array ( 'cssFile' => '/css/style-gridview.css', ) ), );  
October 9, 2010

DropDown for pageSize in CGridView

A convenient drop down to select page size and save in User state. Step 1: On top of my controller action for the gridview (if you used CRUD, this is actionAdmin() ) i added: // page size drop down changed if […]
October 4, 2010

How to change content of a cell in Grid View to a link

If you want to link content of cell in Grid View to some page e.g In orders list, if you want customer’s name to be link that takes admin to customer’s detail page, change the columns of CGrid View as […]
October 4, 2010

Ajax button in CGridView

To add an ajax button to CGridView modify the buttons column  as   'columns' => array( 'id', 'name', array( 'class'=>'CButtonColumn', 'template' => '{view} {update} {delete}', 'buttons'=>array( 'view' => array( 'url'=>'"index.php?r=admin/view&id=".$data->user_id."&m=users"', 'click' => "function (){ $('#viewTab').load($(this).attr('href'));return false; }" ) ), ), […]
get in touch
gdpr-image
This website uses cookies to provide necessary website functionality, improve your experience and analyze our traffic. By using our website, you agree to our Privacy Policy and our cookies usage.
READ MORE