Is it possible to regenerate pagnation after I have made ajax call that changes number of pages that would be returned?
this is how I call it in the blade right now
$comments->links()
Then I allow user to appove/unapprove/mark as spam etc using ajax and after I made ajax call I would like to regenerate pagination without having to reload the page, has anyone done it and how?
Seems like you should have done your pagination in first place in js, something line vue.js makes it easy to work with:
http://www.vuescript.com/pagination/
Related
Is there any way in codeigniter Pagination, such that when I click on next page in links my page should not get reload?
I am done with pagination But I am not able to solve this query.
Please Help.
Thank you
Short answer: No
Long answer: What you're asking is creating an AJAX pagination: The "not reloading page" effect is achieved when you use AJAX, that is, programming into the client side to call the server and only reload a part of the website.
That's said, if you wanted to get that, you should look for something like: Codeigniter jquery ajax pagination
How to create pagination in codeigniter using Ajax? I know how to create simple pagination, but am struggling how to create this thing using ajax.
I happened to stumble on this great project which turns your pagination into Ajax without much coding to your PHP files.
If you don't mind "Scroll to load", you can try out http://www.fieg.nl/infinite-ajax-scroll-a-jquery-plugin
Even if you don't prefer scroll to load, it should give you some idea behind ajax pagination.
How do I get data from the database, without refreshing the page?
I dont even know where to start...
In Rails you will need to implement a page that pulls data from the DB and shows the data in whatever format you prefer, plaintext/json/xml. There's no asynchronous stuff in this part.
Ajax will be happening in frontend, the javascript part, that asynchronous connects to the webpage that you made above. jQuery's $.ajax will save you a lot of time.
You'll need to make your AJAX call from either an onload.js or a page specific js file (example.js). You'll then need to run a $.get or $.post call to the URL of the data.
Here is a pretty detailed tutorial: http://www.tutorialspoint.com/ruby-on-rails/rails-and-ajax.htm
Is there a way in web2py for SQLFRORM.grid pagination to not refresh the whole page without the use of the LOAD function?
In general, refreshing something on the page with data from the server without reloading the whole page will require an Ajax call (or websockets, or an iframe). The easiest way to do that in web2py is probably to use the LOAD() helper, though you could set up the Ajax manually as well.
Can I refresh the whole page after making ajax calls. kindly check my code on this link for details. Actually I am saving on different server and I am making calls from different url and to see the changes refreshing the page is a must. Kindly let me know if you need more details.
problem in refreshing the page after making two ajax calls
Thanks
No point in using AJAX if you are just going to refresh instantly after. Might as well just POST and let it do the refresh there. I realize this is what was said on the other thread but it's because it makes sense. For whatever reason though, if you still want to refresh, try using the jQuery AJAX call and in your success function just do window.location.reload(), that should work.
check out my answer
problem in refreshing the page after making two ajax calls