Revision #4 has been created by bluyell on Apr 3, 2014, 9:51:46 PM with the memo:
reduce text in step4
« previous (#3) next (#5) »
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 ?[...]