javascript - How to reset Page to 1 using Flexigrid - Stack Overflow

I am currently using Flexigrid which is great. However when i am on say page 8 of a particular list of

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 badges
Add a ment  | 

2 Answers 2

Reset to default 6

newp : 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();

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745427107a4627229.html

相关推荐

  • javascript - How to reset Page to 1 using Flexigrid - Stack Overflow

    I am currently using Flexigrid which is great. However when i am on say page 8 of a particular list of

    3小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信