Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 5th, 2012  |  syntax: None  |  size: 0.75 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.         (function(window,undefined){
  2.                 // Establish Variables
  3.                 var     History = window.History;
  4.                 State = History.getState();
  5.                
  6.                 // Bind to State Change
  7.                 History.Adapter.bind(window, 'statechange', function(){ // Note: We are using statechange instead of popstate
  8.                         // Log the State
  9.                         var State = History.getState(); // Note: We are using History.getState() instead of event.state
  10.                         $.each($.fn.yiiGridView.settings, function(index, element){
  11.                                 var beforeAjaxUpdate = element.beforeAjaxUpdate;
  12.                                 element.beforeAjaxUpdate = undefined; // unset the before handler that stops normal clicks to trigger ajax
  13.                                 $.fn.yiiGridView.update(index, {url: State.url});
  14.                                 // set again the before handler
  15.                                 element.beforeAjaxUpdate = beforeAjaxUpdate;
  16.                         });
  17.                 });
  18.         })(window);