Layui search page initialization table

Question: In view data, the page number to 100, but when using the search function, pass the background page is not 1, but 100, then how initialization table paging it?
1, the original wording:

table.reload('tb-zhoubao', {
                url: layui.setter.request_urlOnline + "/zhoubao/search_"
                , method: "POST"
                , contentType: 'application/json'
                , where: {
                    key: search_key,
                    value: search_value
                } //设定异步数据接口的额外参数
            });

2, the revised wording: only need to add the page parameter to initialize page

table.reload('tb-zhoubao', {
                url: layui.setter.request_urlOnline + "/zhoubao/search"
                , method: "POST"
                , contentType: 'application/json'
                , where: {
                    key: search_key,
                    value: search_value
                } //设定异步数据接口的额外参数
                ,page: {
                    curr: 1
                }
            });

Simple right? Simple, right

Published 27 original articles · won praise 7 · views 3510

Guess you like

Origin blog.csdn.net/qq_33966519/article/details/104969315