-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Accessing features from a json file for data-side-pagination="server" #2105
Comments
@nyarachm - you do know what "server-side" means? "client-side" means js code doing most the grunt work, "server-side" is where you point to a server side SCRIPT (NOT a raw data file) that handles the param you send along with it and returns prepared results. There is nothing bootstrap-table has to do with that process, except in the name and values of param sent, and you can even configure those to whatever you want. Hit F12 and see whats actually being sent and returned in network requests to see what i mean. If still unsure, then through issues and ect for server side code or just google to find similar scripts in whatever language and database/datastore your using then change param to match naming scheme. |
@nyarachm - I like that your looking at other issues, but you need to make better use of the search feature here and remember to remove "is:open" filter. And please dont spam same question in barely related posts when it does fit far better here in its own thread (or in the duplicate thread i linked to above) Thanks |
@dabros Hi, thanks for the quick advice! Sorry about asking all over. I have had a look at #1980 as well as the other links previously and have successfully managed to fix the pagination issue. This is my first time using json as before I used to use ajax. However this did not fix the search, sort, and export functions. This issue only happens when I get data from server. I am still looking around the 'issues' area (and your links) for a possible solution and will report on my success or failure. Thanks |
Positive Update! Massive thanks to @jaydeepgiri in #617. I finally got the sort feature working. The 5 golden variables (the author of the documentation should really add these in): For those in need of a guide make sure your php file that contains the sql queries makes use of these variables (depending on the situation i.e apply $_GET['sort'] and $_GET['order'] in your query in the sql order: ORDER BY $sort $order) and run the query when the situation arises: if (isset($_GET['sort'])) { ...now for the search and export features... |
@nyarachm - those are in the documentation, very clearly detailed in http://bootstrap-table.wenzhixin.net.cn/documentation/#table-options It could be more prominent there perhaps, but it shouldnt need to be given that skimming the short descriptions should flag it, and more importantly your expected to know how to hit F12 and view network requests, as I directed you to earlier. Glad that you got it working, but if you dont understand the steps someone tells you to find something then say that, so you can improve your ability to improve yourself Web inspector/developer tools are critical to this kind of work, so make sure you get familiar with using them too as they will help you a lot. |
I'm also hitting the same problem with the export function not working with Happy to provide a jsfiddle or open a new issue if needed. If it's a known limitation, also happy to whip up a quick PR. |
@sampeka - please try not to post in other topics on same issue without linking ref #2220 |
@dabros, apologies - my bad, I opened the new issue for a clearer title and a more focused subject, but if you'd rather track the issue here I'll close it. |
@sampeka - its better you opened new issue, and i like the added clarity, just remember to backlink to related topics (from either side), especially if you posted same question : ) |
Fixed in #3830 |
Hi,
I am testing out the table features on my localhost and successfully used the search, sort, pagination and export when using data-side-pagination="client" (and configuring the json file as shown in the documentation).
without server-side (works): https://github.com/wenzhixin/bootstrap-table-examples/blob/master/json/data1.json
with server-side (NOT working): https://github.com/wenzhixin/bootstrap-table-examples/blob/master/json/data2.json
When I change to server-side, I successfully get the data to output in the table but all the features do not work (search, sort, pagination and export). Export outputs the entire table.
I have had a look here http://jsfiddle.net/4r6g4cfu/3/light/ and when I replicate this example and use the data-url (http://mikepenz.com/jsfiddle/) provided it works. But my http://localhost/testtable/scripts/json/test.json doesnt.
NOTE: http://localhost/testtable/scripts/json/test.json is identical to http://mikepenz.com/jsfiddle. I copy/pasted
The text was updated successfully, but these errors were encountered: