RRListView - a CListView extension to allow Ajax browser history

If you try my modification it is exactly what you mean modifications in the #yw0 part of the url would make changes to the #yw0 widget only.
Just add 2 gridviews on the same page and test it out.

I was talking more about different widgets (or even custom ajax updates).
But I will certainly have a look and get back to you. Unfortunately I'm in the middle of a project at the moment so don't have time to look yet.

@pcs2112 good to hear that my solution also works for others.
But i don't understand your request because if i use the advanced search form on my site the gridview will get rendered correctly and after a successful ajax update the bbq url part is also correctly. And if i use the forward/backwards buttons of my browser the advanced search form options also get the values accordingly.

awesome thanks for the reply your modification of the yiigridview works perfectly . I added jquery blocking to make the loading of the grid similar to what you see in google when enterinf a new search or change the page.

I will also upload the same thing for CListView fairly soon, but I don't have the time to do it at the moment because my brother is visiting me.

Hi, thanks for that. I've tested your clistview widget but it doesn't work for me. When i use the pagger, then the links appear to be incorrectly encoded. Some like index.php?r=controller%3ffunction. Seems like it's encoding the /, and then i get an error

Ok, for those impatients
Here is the latest version of GridView, which I haven't yet had time to document or package nicely (and no instructions yet).
I will do a proper packagae, and upload as an extension for both ListView and Gridview in the next week or so.

Ok, so here are both the CListView and CGridView extensions RRViews.zip(13.71K)Number of downloads: 15.
I haven't yet included any documentation, but they are fairly well commented.

They are perhaps not the perfect solution - it really depends on what you want them for. I have preferred to assume integration between query parameters in the browser bar url and for the ListView/GridView (I'm perhaps obsessed with the symmetry between ajax and non-ajax requests, so I want my querystrings to represent the correct state as a whole as it may be accessed with or without javascript).
This does mean that:

you cannot have different listviews/gridviews on the same page that use the same GET parameters (so for two listviews for example, you would have to change the pagination and sorting GET vars for them to work together)

all the widgets on the page must be accessed from the same action that generated the page (this can easily be got around but perhaps with a loss of coherence between the different parameters)

I have changed my approach for parsing parameters from updaters - previously I imitated the original js implementation by extracting the parameters from the normal link, and merging them with those in the key link for the widget, perhaps overriding them with parameters from the location querystring or the hash fragment, but I believe this can lead to inconsistencies.
So now, when binding the links, I assume a parameter (which means it is harder to add custom updaters, especially ones which change more than one parameter). Thus for paging links I will only extract the pageVar parameter, and for sorting links likewise.

Handling the input ajax (for the gridview) seems good, with entering text in one input only adding one parameter, and removing text from one not resulting in others being erased.

The hash handling logic is still in a separate javascript file, and could probably do with an overhaul (the error mechanism doesn't work very well), but that will have to come later as it still works.

The advanced search function (which is not actually part of CGridView) can be included in this, simply by manually defining the selector for the input updaters.

So an example of the parameters to add to the widget's construction would be:

where $searchId is the id that I have added to the div containing the advanced search form, inputUpdater is the selector for the input elements that should trigger an ajax update (a custom field that I have added, normally calculated automatically in the javascript file, but defined manually here so as to include the inputs from the advanced search form) and $gridId is the id given to the gridview widget.
Adding $searchId to the ajaxUpdate means that whenever the grid is updated, the search form is also updated.
Personally I also think that the submit button should be hidden using javascript, since it has no function here.

I hope this works for you all. Please let me know if there are any bugs.
Once I have ironed everything out I will make it available as an extension.

I should have said - to use, jus unzip into the extensions folder, then for your widget use 'ext.RRListView' etc

Without any error reports it is hard to see what would be causing it - are there no error reports in the Firebug console?
Look in Firebug too to see if the script files were actually downloaded.
The one thing I can think of is that your directory structure might be different - I assume that you unzip the files into the extensions directory so that RRListView.php and RRGridView.php are in the extensions root and the assets subfolder contains the javascript files. That should work by default (as long as the ext alias is defined). If that is not the case then you will have to explicitly give the assets folder to the widget using the extensionAssets parameter, like: