Wiki

Articles tagged with "cgridview", sorted by ratingX
Displaying 11-20 of 65 result(s).

Keeping a running total in a CGridView

Created 4 years ago by Steve FriedlHow-tos4 comments – viewed 27,296 times – ( +24 ) – version 1.1
This tip created in conjunction with IRC #yii channel users emilsedgh and tydeas - thanks!
tags: CGridView

Avoiding rendering entire page when using CGridView and CListView via AJAX

Created 4 years ago by xrxHow-tos17 comments – viewed 36,115 times – ( +24 ) – version 1.1
Since I used CGridView for a first time, I didn't like how it handled operations like sorting, filtering, changing page and etc using AJAX.

How to show ajax delete status in CGridView like flash messages

Created 4 years ago by hasanaviHow-tos12 comments – viewed 39,745 times – ( +24 ) – version 1.1
I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully deleted or if there are some problem in flash style (setFlash() / getFlash())

Using filters with CGridView and CArrayDataProvider

Created 3 years ago by marcovtwoutHow-tos32 comments – viewed 57,432 times – ( +21 ) – version 1.1
Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created 2 years ago by yJeroenTutorials8 comments – viewed 50,443 times – ( +19 ) – version 1.1
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.

CGridView: Use special variable $data in the htmlOptions of a column (i.e. evaluate htmlOptions attribute)

Created 3 years ago by c@cbaTutorials3 comments – viewed 49,494 times – ( +28 / -1 ) – version 1.1
    For each column of the CGridView, we can specify name, value, htmlOptions, cssClassExpression etc. In the declarations of the attributes value and cssClassExpression we can use the "special" variable $data, for example like this: 'value'=>'$data->author->username',.     Now we might want to use $data in the declaration of the htmlOptions attribute, which is normally not possible, to generate for example the tag <td id="3" class="name_3">, where 3 is the id of the data model for the current row, i.e. $data->id. That is, we want to be able to use: 'htmlOptions'=>array('id'=>'$data->id', 'class'=>'"name_{$data->id}"')     Here's a way to accomplish this...

Create custom button button with AJAX function in CGridView

Created 2 years ago by nkdHow-tos2 comments – viewed 43,840 times – ( +18 ) – version 1.1
CButtonColumn in CGridView can be customised to include user built buttons. To learn a great deal about including custom buttons, read this excellent wiki. This tutorial will show how to call an action from one custom button using AJAX instead of regular GET calls.

Dynamic parent and child CGridView on single view. Using $.ajax to update child gridview via controller, after row in parent gridview was clicked.

Created 3 years ago by Gerhard LiebenbergTutorials20 comments – viewed 77,363 times – ( +27 / -1 ) – version 1.1
This wiki is a step-by-step example explaining how the controller, model and the view's CGridView work together. It explains simple things - as well as more complex things that you will anyway quickly have to know. So, even if you don't use dynamic gridviews, take a morning off and thoroughly work through this tutorial. It should save you lots of struggling.

Using standard filters in CGridView custom fields

Created 4 years ago by GOshaHow-tos4 comments – viewed 56,069 times – ( +17 ) – version 1.1
In this article I'll try to explain how to use standard quick search fields in CGridView with customized columns.For example: We have a record in a database with field switch having 0 or 1 values. After that we want a user to see on or off instead 1 or 0. So we do the usual thing:

CGridView: Display the full record (actionView) in a CJuiDialog

Created 3 years ago by JobloTips7 comments – viewed 38,905 times – ( +15 ) – version 1.1
If you show a model (with a lot of attributes) partially in a CGridView, it can be helpful when the user can take a quick look at the full record with all attributes without displaying the view as a page and afterwards returning back to the gridview.