Reputation: 19
I am facing one problem in my javascript code.I am calling one url that is returning one partialview and loading it in a div.After that i have tablesorter method for pagination.But after loading that url paging is not working properly. My code is below:
CODE SECTION:
function FileMastergridpage(text) {
var url = encodeURI("Setpagesize_allrulesgrid?pagesize=" + text + "");
jQuery("#ruledetailsgrid").load(url, paging_function() );
}
function paging_function (){
alert('hello');
jQuery("#StandardGridid").tablesorter();
jQuery("#StandardGridid").tablesorterPager({ container: jQuery("#pagerOne"), positionFixed: false });
}
I am not able to get the 'hello' alert also.So any help will be highly appreciated..
Upvotes: 1
Views: 88
Reputation: 4591
Your code will either be like this :
function FileMastergridpage(text) {
var url = encodeURI("Setpagesize_allrulesgrid?pagesize=" + text + "");
jQuery("#ruledetailsgrid").load(url,function() {
alert('hello');
jQuery("#StandardGridid").tablesorter();
jQuery("#StandardGridid").tablesorterPager({ container: jQuery("#pagerOne"), positionFixed: false });
});
or :
function FileMastergridpage(text) {
var url = encodeURI("Setpagesize_allrulesgrid?pagesize=" + text + "");
jQuery("#ruledetailsgrid").load(url, paging_function );
}
function paging_function (){
alert('hello');
jQuery("#StandardGridid").tablesorter();
jQuery("#StandardGridid").tablesorterPager({ container: jQuery("#pagerOne"), positionFixed: false });
}
Upvotes: 0
Reputation: 782466
It should be:
jQuery("#ruledetailsgrid").load(url, paging_function);
You're calling the function immediately, not passing it as a callback.
Upvotes: 4