
Untitled
By: a guest on
May 5th, 2012 | syntax:
None | size: 0.75 KB | hits: 12 | expires: Never
(function(window,undefined){
// Establish Variables
var History = window.History;
State = History.getState();
// Bind to State Change
History.Adapter.bind(window, 'statechange', function(){ // Note: We are using statechange instead of popstate
// Log the State
var State = History.getState(); // Note: We are using History.getState() instead of event.state
$.each($.fn.yiiGridView.settings, function(index, element){
var beforeAjaxUpdate = element.beforeAjaxUpdate;
element.beforeAjaxUpdate = undefined; // unset the before handler that stops normal clicks to trigger ajax
$.fn.yiiGridView.update(index, {url: State.url});
// set again the before handler
element.beforeAjaxUpdate = beforeAjaxUpdate;
});
});
})(window);