Difference between #3 and #5 of
Making a CGridView to keep the selection between page changes

Changes

Title unchanged

Making a CGridView to keep the selection between page changes

Category unchanged

Tutorials

Yii version unchanged

Tags unchanged

CGridView CGridColumn

Content changed

[...]
'lastname',
),
));
```

4) Now the magic,
themake an instance of the class EKeepSelection, you will never use the instance, it is only provided as a Wrapper class to make the usage easy for you, the unique goal of this instance is to make your jquery CGridView object making usage of the new provided jQuery extension: $.fn.keepSelection()
 
 
By now, please keep focused in only provide the instance near to the widget definition:
 
 
~~~
 after the widget body:
 
 
 
```php
$dummy = new EKeepSelection('#my-gridview'); ~~~```

Done. Now your CGridView widget is keeping the selection no matter if you change the current page (in case your data provider has many pages), or if you update your CGridView.

##Now what ?
[...]
2 0
3 followers
Viewed: 13 152 times
Version: 1.1
Category: Tutorials
Written by: bluyell
Last updated by: CeBe
Created on: Mar 21, 2014
Last updated: 10 years ago
Update Article

Revisions

View all history