I was wondering if it’s possible to change it back to pagination after this ajax request? Currently I remove grid header (displaying records 1-10 of 100) and pagination at the bottom using
Thanks zaccaria, it works great, I didn’t know about this feature! There is only one minor issue - if pager is hidden when page first loads, style sheet of it isn’t included in the page HEAD section, so pager oesn’t look nice…
What would be the most elegant way to include this file all the time?
Also, I would like to change link text and content after clicking. I tried the following approach but it didn’t work:
if ($viewAll == 0) // $viewAll is set in corresponding controller and get changed after clicking the link to 1.
echo CHtml::link(
"View All", ...
);
else
echo CHtml::link(
"Hide All", ..
);
In the controller I check view_all param and make some changes to the CGridView control, for example change pageSize of pagination property from 25 to 100.
This works great, but I can’t find a solution to change this “View all” link to “Hide all” right after clicking, so I could click this “Hide all” link and apply all original settings. After that “View link” will become available again.
I hope this clarifies it, but I can explain in more detail if necessary.