New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server-side pagination not displaying pages or row count ; search not working ; sort not working #617
Comments
Can you show us your json response?? |
The response from the server-side code? Yeah I'd be happy to. What's the best way to do that? |
Just debug your code.. F12 and I think you can get the json object in the constructor method. |
And before that... Instead of pageSize use data-page-size="25" in your table options |
And also you can't use the validation on the data-sort-name |
When you use
for example: http://wenzhixin.net.cn/examples/bootstrap_table/data |
@djhvscf I'm new to web developement, so I've never debugged code before through the inspection console. I'm mainly used it to look at the rendered html elements, and to debug through prints to the console. I'll look into trying to actually step through my code to find the returned JSON object. My table renders fine on screen, but none of the pagination, or client-side functionality works. From the looks of it, the JSON returned by the server has 0 rows. Thanks for the data-page-size correction. That fixed a client side problem I was having. @wenzhixin Thanks. I'll have a look at your example. I thought the server-side code was supposed to do this already. I'm a bit confused as to what I have to add myself versus what is taken care of already by the new code. The guy who wrote the server-side pagination code only says in his example to add the data-side-pagination='server'. There is no mention of any new javascript handling, what the data format should be into the table itself, or of which features you implemented that now break when switching from 'client' to 'server'. Is there an issue link or example that addresses these issues? Has other people experienced this? |
See this.. http://jsfiddle.net/4r6g4cfu/3/light/ |
Ok. I think I've got it kind of working, but I'm still having some issues. I've seen this example before but I guess I never quite realized that the key for it working was the data-url attribute. Since this was used in all of the examples, even the client side example, I thought this was just a convenient way of representing the data. So I wasn't used it, but still passing in my data directly into the table. So now I have a table like
The '/manga/gettable' data-url points to something that returns this Are these features something I have to implement myself? Looking at the bootstrap-table.js code, there are code bits that seem to do searching and sorting with server-side pagination. In the example you listed, the sorting and searching seem to work. Is this inherent in the bootstrap-table code, or something that is added somewhere else? |
Hey @wenzhixin , can I get your help in understanding your example code you posted. I managed to get the pagination part working, and now I'm working on implementing the searching and sorting. I'm following this example https://github.com/wenzhixin/bootstrap-table-examples/blob/master/431.html, which presumably uses this example.js code (https://github.com/wenzhixin/blog/blob/master/routes/examples.js) on the server side. In your javascript code here,
how are you passing the search and sorting parameters to the server? The only way I could get my server side to recognize the search text was by modifying your code to
This correctly passes the search text in, and I can properly filter and return the results, however the code always sends a final request of an empty search, which resets my results, even though my search field still has my text typed in it. Any ideas on this? |
Hi @havok2063 , you can look at this example: http://issues.wenzhixin.net.cn/bootstrap-table/#options/server-side-pagination.html |
Close this. |
Why do you close issues that aren't solved? Your example didn't solve the problem for me. |
OK, I thought it was resolved by mistake. |
@wenzhixin 我试了试 http://127.0.0.1:8000/data?offset=0&limit=10 搜索框字符改变的时候 还是传的offset=0&limit=10 没有传search 另外还有个order也是默认传的? |
好像data-url 就可以
这种就不行 请问默认的方法你是怎么写的? |
@n37r06u3 you need to set sidePagination to server |
Use sidePagination: 'server' option to define the server side pagination of table. 我现在的时这样 不用data-url search参数就传不了 |
你好,我通过action类已经获得了数据库数据(json)格式,同时也传递到了页面上,但是加载到表格上却显示没有找到匹配数据。 |
|
自定义 搜索怎么弄啊 |
Hi folks, I have the json result with total count and row array in different format. How can I load to the data to the table? It seems it only take data-url as the parameter for server side paging. Thanks in advance |
@wenzhixin I have solved this problem |
Can you show the solution? @xujianghao |
Hi, would it be possible to create commented example/walkthrough, possibly also with sample SQL interface on server-side? |
@DavidKrupi , I will consider your feature, I think it is the same with #256. |
@wenzhixin Hi folks, I have the json result with total count and row array in different format. How can I load to the data to the table? It seems it only take data-url as the parameter for server side paging. Thanks in advance |
You can load from an url, or use |
Please double check this, but it looks like client side pagination is using I've created pull request #1798 With this fix applied server side search is working with following HTML:
Cheers, |
Server side paginations uses this.options.searchText, fixes #617
Hi @wenzhixin i am using bootstrap table in my application. all the sorting logic we implemented in server side and using below is my question with details. |
Can you give us the steps to reproduce the issue?? use this fiddle http://jsfiddle.net/wenyi/e3nk137y/18/ @sriramareddy143 |
@xujianghao 请问你是怎么解决的?我json格式也是对的,可是就是一直No matching |
Thanks a lot again @wenzhixin for such a great work. Now everything is working fine on my server side pagination table ( Sorting, Searching etc., ) Hello guys i would like to let you know people that, Please utilize the following parameters in
Please avoid confusions and go for this. Thank you.. |
any pull request is welcome @jaydeepgiri |
@jaydeepgiri Can I see how you got your search working (particularly the PHP script)? I do not know how to go about this. I also had issues with the sort but thanks to the variables you posted I got it working. WHERE x=4 LIMIT $offset, $limit |
Hello @nyarachm, I am glad to know that my small work helped you.. Now for searching it is done in the same way, i'll show you my piece of code for the same.. below is the mysql - PHP code-->>
It is that simple as shown above.. |
@glorang : Please provide the working solution code of cshtml and controller. |
@sriramareddy143 : Please provide the working solution code of cshtml and controller. Need help on server pagination and search |
Hi. I'm new here. I just switched my pagination over to server-side, with the default parameters, as indicated on the example page, and a bunch of javascript related things aren't working.
'Showing 1 to 0 of 0 rows' , with no page controls on the right-hand side.
My table is set set up like
Am I missing something in the setup to activate it? I could not find another issue related to this one.
Bootstrap-table-flat + data-side-pagination="server" + search not working #434, but this did not fix the problem.
Am I missing some javascript somewhere to get the server-side pagination set up properly?
Thanks for your help.
The text was updated successfully, but these errors were encountered: