-
AuthorPosts
-
ilet Friend
ilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
August 23, 2015 at 5:56 pm #664777I 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 ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
August 24, 2015 at 7:46 am #664869Hello 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 ModeratorMo0nlight
- Join date:
- September 2014
- Posts:
- 707
- Downloads:
- 38
- Uploads:
- 107
- Thanked:
- 99 times in 97 posts
August 24, 2015 at 7:46 am #746371Hello 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 Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
August 24, 2015 at 2:21 pm #665005hi,
It works when I don’t use the filter. After using the filter the pagination once again start using ajax loading.
ilet Friendilet
- Join date:
- February 2009
- Posts:
- 25
- Downloads:
- 0
- Uploads:
- 0
- Thanks:
- 2
- Thanked:
- 5 times in 1 posts
August 24, 2015 at 2:21 pm #746409hi,
It works when I don’t use the filter. After using the filter the pagination once again start using ajax loading.
-
AuthorPosts
This topic contains 7 replies, has 3 voices, and was last updated by BigHug 9 years, 2 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum