test
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • gswahhab Friend
    #196758

    I would like to run a javascript function after loading results from an Ajax Search using the JA K2 Filter module. Is there a javascript event or similar hook that I could add my custom JS to? If possible, I would like to extend the component instead of overwrite it.

    Example javascript (desired):


    function doSomething() {
    console.log("hi. I'm doing something");
    }
    jQuery('#k2Container').bind('afterJak2Filter', doSomething);

    This is currently possible by extending jQuery’s html function, but that seems like a bad idea if avoidable.
    If you’re interested in knowing how to do this:


    var originalHtmlFunction = jQuery.fn.html;
    jQuery.fn.html = function(){
    var ret = originalHtmlFunction.apply(this, arguments);
    doSomething();
    return ret;
    }

    Thanh Nguyen Viet Friend
    #530910

    The ajax handler function of JA K2 filter component does not support param for on-success callback function now. So if you need add something after result page is loaded, you need to customize ajax hander function in the modules/mod_jak2filter/assets/js/jak2filter.js file (the function name is “jak2AjaxHandle”)

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Thanh Nguyen Viet 10 years, 7 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum