Ajax reloading a view with ajax mini pager I have this view, a 'block' display that has ajax enabled and have a mini pager that loads next page content through ajax.

As a requirement I have to reload the current view content through ajax along with some custom sort/filter. 

After going through some forums, I did something like below.

in .module page callback :

$view = views_get_view('vdlibrary');
$view-&gt;set_display('block');
$view-&gt;set_use_ajax(TRUE);

$settings = array(
    'views' =&gt; array(
        'ajax_path' =&gt; url('views/ajax'),
        'ajaxViews' =&gt; array(
            array(
                'view_name' =&gt; $view-&gt;name,
                'view_display_id' =&gt; $view-&gt;current_display,
                'view_args' =&gt; check_plain(implode('/', $view-&gt;args)),
                'view_path' =&gt; check_plain($_GET['q']),
                'view_base_path' =&gt; $view-&gt;get_path(),
                'view_dom_id' =&gt; 1,
                //'pager_element' =&gt; $view-&gt;pager['element'],
            ),
        ),
    ),
);
drupal_add_js($settings, 'setting');
views_add_js('ajax_view');


in JS I am calling below ajax function on a click event to load the new views content based on the condition.

for (var key in Drupal.settings.views.ajaxViews[0]) {
  data[key] = Drupal.settings.views.ajaxViews[0][key];
}
// I add additional filters/sort params to var data.
$.ajax({
  url: Drupal.settings.views.ajax_path,
  type: 'GET',
  data: data,
  dataType: 'json',
  success: function(response) {

    $(".vdr_container").html(response[1].data);

  },
  error: function() {
    // handle error response.
  },
});


Not surprisingly, after it loads the content, the ajax pagination feature not working instead it reloads the page along with params. How do I keep the old context or make the new loaded views to rebind pager click event to work with ajax pager.

NOTE: my descriptions might not be good enough, let me know where I could explain in better way.

Thanks
After going through ajax_views.js and understanding view-dom-id element structure, finally I could able to get this done.

In ajax response object, there are 3 callbacks, In the last 'insert' callback, I got data with command to 'replacewith' and a DOM selector (unique dom for views wrapper with '.view-dom-id-xxxxx'). So I did replace the new content like :

$(".view-dom-id-" + vDomId).replaceWith(response[2].data);


Then I got the content with existing context, all I had to do then is re-attach the 'ViewsAjaxView' behavior as found in ajax_view.js

Drupal.attachBehaviors('ViewsAjaxView'); 


This attachBehaviors function will take care of binding ajax pagination to my newly altered views data.

I still feel, as if this can be more simpler like running all callbacks I get in response variable in success. I will post more if I get into. Hopefully someone gets some help from this.

Anybody have idea to run those commands?