admin管理员组文章数量:1425031
I am currently using Flexigrid which is great. However when i am on say page 8 of a particular list of books then i change to another set of books which has less than 8 pages, the Flexigrid loads Page 8 with nothing on it...
I am just wondering how to reset the 'page' value to 1. I have tried:
$("#books").flexOptions({ url: '/books/list', params: [{ name:'bookId', value: $('#Books').val()}, {name:'fromDate', value: $('#fromDate').val()}, {name: 'toDate', value: $('#toDate').val()}]}).flexReload({ page: 1 });
and
$("#books").flexOptions({ page: 1, url: '/books/list', params: [{ name:'bookId', value: $('#Books').val()}, {name: 'fromDate', value: $('#fromDate').val()}, {name: 'toDate', value: $('#toDate').val()}]}).flexReload();
Any help is much appreciated.
I am currently using Flexigrid which is great. However when i am on say page 8 of a particular list of books then i change to another set of books which has less than 8 pages, the Flexigrid loads Page 8 with nothing on it...
I am just wondering how to reset the 'page' value to 1. I have tried:
$("#books").flexOptions({ url: '/books/list', params: [{ name:'bookId', value: $('#Books').val()}, {name:'fromDate', value: $('#fromDate').val()}, {name: 'toDate', value: $('#toDate').val()}]}).flexReload({ page: 1 });
and
$("#books").flexOptions({ page: 1, url: '/books/list', params: [{ name:'bookId', value: $('#Books').val()}, {name: 'fromDate', value: $('#fromDate').val()}, {name: 'toDate', value: $('#toDate').val()}]}).flexReload();
Any help is much appreciated.
Share Improve this question asked Apr 16, 2012 at 6:45 Mr-DCMr-DC 8695 gold badges15 silver badges29 bronze badges2 Answers
Reset to default 6newp : 1
is the trick here.
$('#MyFlex')
.flexOptions({
url: urlAction,
newp: 1
}).flexReload();
What you can do is simply locate the "First" button and trigger the click event on it. So let's say your table is contained into an div with an id of container (it's good to target a context if you have multiple tables grid)
$('#container .pFirst').click();
本文标签: javascriptHow to reset Page to 1 using FlexigridStack Overflow
版权声明:本文标题:javascript - How to reset Page to 1 using Flexigrid - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745427107a2658164.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论