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

Avoiding rendering entire page when using CGridView and CListView via AJAX

Created 6 years ago by xrxHow-tos17 comments – viewed 41,221 times – ( +25 / -1 ) – 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 6 years ago by hasanaviHow-tos12 comments – viewed 46,285 times – ( +25 / -1 ) – 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())

Keeping a running total in a CGridView

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

Using filters with CGridView and CArrayDataProvider

Created 5 years ago by marcovtwoutHow-tos33 comments – viewed 72,725 times – ( +23 / -1 ) – version 1.1
Using filters on CGridView with CActiveDataProvider is easy, but with CArrayDataProvider it is a bit tricky.

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

Created 5 years ago by c@cbaTutorials3 comments – viewed 63,608 times – ( +28 / -2 ) – 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...

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

Created 5 years ago by Gerhard LiebenbergTutorials20 comments – viewed 92,316 times – ( +28 / -2 ) – 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.

Displaying, sorting and filtering HasMany & ManyMany relations in CGridView

Created 4 years ago by yJeroenTutorials8 comments – viewed 59,661 times – ( +21 / -1 ) – version 1.1
This tutorial gives you multiple options of how to fully implement showing, sorting and filtering related data in gridviews.

Create custom button button with AJAX function in CGridView

Created 4 years ago by nkdHow-tos2 comments – viewed 54,631 times – ( +19 / -1 ) – 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.

Special $variables in CGridView and CListView

Created 5 years ago by Steve FriedlTips11 comments – viewed 64,275 times – ( +27 / -3 ) – version 1.1
The popular CListView and CGridView widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

Using standard filters in CGridView custom fields

Created 6 years ago by GOshaHow-tos4 comments – viewed 63,120 times – ( +17 / -1 ) – 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: