test
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • ilet Friend
    #664777

    I want my filter to use ajax, but not pagination. When a user click on an item, and decides to hit the back button, it doesn’t go back to the page they were at; or maybe in the future add a page in the URL.

    Mo0nlight Moderator
    #664869

    Hello ilet.
    You can follow these steps.

    File : modulesmod_jak2filtertmpldefault.php
    delete the line : 440
    [PHP]jak2AjaxPagination(jQuery(‘#k2Container’), ‘<?php echo JURI::root(true).’/’; ?>’);[/PHP]

    File : modulesmod_jak2filterassetsjsjak2filter.js
    delete the line : 272
    [PHP]jak2AjaxPagination(container, K2SitePath);[/PHP]

    And
    edit from line 184 – 200
    [PHP]function jak2AjaxSubmit(form, K2SitePath) {
    //if Container K2 does not exist, submit form to redirect to K2 Filter result page
    if(jQuery(‘#k2Container’).length) {
    jak2AjaxStart();
    jQuery.ajax({
    type: “POST”,
    url: jQuery(form).attr(‘action’),
    data: jQuery(form).serialize(),
    success: function(text){
    jak2AjaxHandle(text, K2SitePath);
    }
    });
    } else {
    jQuery(form).find(‘input[name=”tmpl”]’).val(”);
    $(form).submit();
    }
    }[/PHP]

    To

    [PHP]function jak2AjaxSubmit(form, K2SitePath) {
    //if Container K2 does not exist, submit form to redirect to K2 Filter result page
    jQuery(form).find(‘input[name=”tmpl”]’).val(”);
    if(jQuery(‘#k2Container’).length) {
    jak2AjaxStart();
    jQuery.ajax({
    type: “POST”,
    url: jQuery(form).attr(‘action’),
    data: jQuery(form).serialize(),
    success: function(text){
    jak2AjaxHandle(text, K2SitePath);
    }
    });
    } else {
    $(form).submit();
    }
    }[/PHP]

    That’s all.
    Feel free to ask if you have any trouble.

    Best & Regards.

    Mo0nlight Moderator
    #746371

    Hello ilet.
    You can follow these steps.

    File : modulesmod_jak2filtertmpldefault.php
    delete the line : 440

    jak2AjaxPagination(jQuery('#k2Container'), '<?php echo JURI::root(true).'/'; ?>');

    File : modulesmod_jak2filterassetsjsjak2filter.js
    delete the line : 272

    jak2AjaxPagination(container, K2SitePath);

    And
    edit from line 184 – 200

    function jak2AjaxSubmit(form, K2SitePath) {
    //if Container K2 does not exist, submit form to redirect to K2 Filter result page
    if(jQuery('#k2Container').length) {
    jak2AjaxStart();
    jQuery.ajax({
    type: "POST",
    url: jQuery(form).attr('action'),
    data: jQuery(form).serialize(),
    success: function(text){
    jak2AjaxHandle(text, K2SitePath);
    }
    });
    } else {
    jQuery(form).find('input[name="tmpl"]').val('');
    $(form).submit();
    }
    }

    To

    function jak2AjaxSubmit(form, K2SitePath) {
    //if Container K2 does not exist, submit form to redirect to K2 Filter result page
    jQuery(form).find('input[name="tmpl"]').val('');
    if(jQuery('#k2Container').length) {
    jak2AjaxStart();
    jQuery.ajax({
    type: "POST",
    url: jQuery(form).attr('action'),
    data: jQuery(form).serialize(),
    success: function(text){
    jak2AjaxHandle(text, K2SitePath);
    }
    });
    } else {
    $(form).submit();
    }
    }

    That’s all.
    Feel free to ask if you have any trouble.

    Best & Regards.

    ilet Friend
    #665005

    hi,

    It works when I don’t use the filter. After using the filter the pagination once again start using ajax loading.

    ilet Friend
    #746409

    hi,

    It works when I don’t use the filter. After using the filter the pagination once again start using ajax loading.

    Mo0nlight Moderator
    #665122

    I can replicate the issue at my end. Seems that it occurs on your site only.

    You can PM me FTP login info so that I can investigate further.

    BigHug Friend
    #746513

    I can replicate the issue at my end. Seems that it occurs on your site only.

    You can PM me FTP login info so that I can investigate further.

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

This topic contains 7 replies, has 3 voices, and was last updated by  BigHug 9 years, 4 months ago.

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