Pager: update goto independently of other elements. Fixes #811

This commit is contained in:
Mottie 2015-02-04 07:29:07 -06:00
parent 8ff560e00f
commit 1ffd4a0a20
2 changed files with 16 additions and 17 deletions

View File

@ -193,16 +193,16 @@
}
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
});
if ( p.$goto.length ) {
t = '';
$.each(buildPageSelect(p), function(i, opt){
t += '<option value="' + opt + '">' + opt + '</option>';
});
// innerHTML doesn't work in IE9 - http://support2.microsoft.com/kb/276228
p.$goto.html(t).val( p.page + 1 );
}
if ($out.length) {
$out[ ($out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
if ( p.$goto.length ) {
t = '';
$.each(buildPageSelect(p), function(i, opt){
t += '<option value="' + opt + '">' + opt + '</option>';
});
// innerHTML doesn't work in IE9 - http://support2.microsoft.com/kb/276228
p.$goto.html(t).val( p.page + 1 );
}
// rebind startRow/page inputs
$out.find('.ts-startRow, .ts-page').unbind('change').bind('change', function(){
var v = $(this).val(),

View File

@ -430,17 +430,16 @@ tsp = ts.pager = {
}
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
});
if ( p.$goto.length ) {
t = '';
$.each(tsp.buildPageSelect(p, c), function(i, opt){
t += '<option value="' + opt + '">' + opt + '</option>';
});
// innerHTML doesn't work in IE9 - http://support2.microsoft.com/kb/276228
p.$goto.html(t).val( p.page + 1 );
}
if ($out.length) {
$out[ ($out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
if ( p.$goto.length ) {
t = '';
$.each(tsp.buildPageSelect(p, c), function(i, opt){
t += '<option value="' + opt + '">' + opt + '</option>';
});
// innerHTML doesn't work in IE9 - http://support2.microsoft.com/kb/276228
p.$goto.html(t).val( p.page + 1 );
}
// rebind startRow/page inputs
$out.find('.ts-startRow, .ts-page').off('change').on('change', function(){
var v = $(this).val(),