JQuery and paging (JQuery question) |
[eluser]worchyld[/eluser]
Hi there, I've got a list of customers that page very well. I want to add JQuery to make it do the hardwork of paging (but it must still page with JavaScript switched off!) Also, how do you make it have that fancy ajax loading gif too? Once finished I'd like to release it, so that people can see JQuery/CI working hand-in-hand is easy. Remove + in scripts Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> The controller is like this; Code: // CONTROLLER Thanks.
[eluser]worchyld[/eluser]
Using that plug-in is great, but it doesn't teach you how to combine JQuery and CI, which is what I'm after. To clarify. In order to make Jquery and CI work, you have to separate them?
[eluser]xwero[/eluser]
No to make the paging work you need to separate javavascript functionality from the php-only version because the php-only version uses an url to browse through the records and with ajax you have a static url
[eluser]xwero[/eluser]
Flexible Paging Plugin is easier if you want to make a javascript paging solution
[eluser]worchyld[/eluser]
Getting the paging to work is fine. Its getting JQuery to do it that's the problem. I don't quite see why I'd want to seperate JQuery and CI in the way you describe. Isn't the reason why I'm putting JQ in there is because is has to deal with dynamic URLs? Could you post examples? Just small ones will be fine. I'm finding little information on Google on what I'm meant to be doing with the data and would appreciate any help via examples. I got the following to work, but its not the right way to do it, as it doesn't do JSON, XML or anything like that -- but it seems to work. There is no "Loading" message as yet. Code: // Put in head Code: // Put in body I know that the above is wrong, but would welcome any examples on how to do it, as I'm really stumped on this.
[eluser]xwero[/eluser]
You are sending the paging url to get new content??? don't you get a full html document instead of a pagepart? You should check your html after the ajax call with firebug. It will work but you end up having messed up html code and it will only work if you can see all the link numbers. There is no easy solution i can think of than to have separate functions for paging or you are going to work out some tricks (cookies seems a choice) which complicate things because the php-only version and the javascript one get tangled together.
[eluser]worchyld[/eluser]
I can seperate the functions, etc, that's no problem - I'll probably do that and go from there. But what'd really help me is if someone could post a paging list of customers that integrates with JQuery. Something simple will do so I can learn from it? That'd be fantastic!
[eluser]worchyld[/eluser]
Sepertion of CI and JQ I've tried to seperate my CI and JQ as much as possible, and reworked my ajax call, but its still not working. It outputs the same page and I also get; Quote:<b>Fatal error</b>: ob_start() [<a href='ref.outcontrol'>ref.outcontrol</a>]: Cannot use output buffering in output buffering display handlers in <b>C:\Program Files\xampp\htdocs\codeignitor\system\libraries\Exceptions.php</b> on line <b>160</b><br /> Here's what I've done; Code: class List_customers extends Controller { Code: // Stick this in your HTML head Code: // Stick this in your body I've split the AJAX call from the rest of the CI code, plus seperated the pagination too, but its still not working. Can anyone help on this? Small code examples would be cool. |
Welcome Guest, Not a member yet? Register Sign In |