Hi there,
I want to alter rupal.Views.Ajax.ajaxViewResponse in order to append loaded views page to previous one instead of replacing it, therefore something like endless scroll could be accomplished. Is this doable without patching this function?

Comments

Remon’s picture

In other words, how could I accomplish something like endless scrolling without disabling current javascript behaviors?

Remon’s picture

Title: Alter drupal.Views.Ajax.ajaxViewResponse behavior » Alter drupal.Views.Ajax.ajaxViewResponse js function to enable endless scrolling
dawehner’s picture

Status: Active » Fixed

Sure this is possible.

Use a js file which is loaded after views file.

Than you can override the behaviour by just copy and paste the function code, and alter it to what you want, but you still have to write the implementation of what you want.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Remon’s picture

Status: Closed (fixed) » Active

Sorry for re-opening this, but frankly I don't think that this is an acceptable solution. I just want to be able to override the response callback. And I don't think it's quite plausible to miss all of views' ajax support for it.

dawehner’s picture

Status: Active » Fixed

I guess you understood me wrong.

function foo() {
    alert('foo is called');
}

function foo() {
    alert('override foo is called');
}
foo();

returns 'override foo is called';

So if you have a js file after views one you can change the stuff as you want.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.