Pagination with XAJAX |
[eluser]ELRafael[/eluser]
Hello boys and girls.... I had a trouble to make a pagination with xajax, cause the links (next, first, 1, 2...) refers to a static link (site_url()./controller/method/n), but i need to invoke a javascript function (xajax_something). Ok, let's explain my solution (still work). If somebody has better ideas, pleeease put here too :lol: First, i mad another class of Pagination (application/main1/libraries/MY_Pagination.php) with this: Code: class MY_Pagination extends CI_Pagination and doppo: Code: // Determine the current page number. OK. I'll put only a call of a href... all still the same :-P Code: // Render the "previous" link chama_ajax() function is only here cause i have a loading image and text before xajax renders the content in the div. Now the abrir_contatos method Code: public function abrir_contatos($_pagina = 0) Guisto!!! Now it's work fine fine to me. If somebody have another idea to do the same post here. Or if is a blonde girl, post the name and phone number :-P
[eluser]sparkling tux[/eluser]
The solution seems quite rigid for me. I've solved the same problem this way: First, I've added new variable Code: var $misc_link_params Next, there's a part where a string is built from these params: Code: // Build line of miscellaneous link params - onclick, etc Finally, I've add some changes to the parts where links are generated, i.e. Code: // Render the "First" link Now, I'm able to add any custom parameters to the pagination links.
[eluser]ELRafael[/eluser]
right... like Code: $misc['onclick'] = 'my_function()'; i already think in an array to call... but in my envrioment doesn't see usefull!! But this generic solution is better :-P thanks
[eluser]!Z[/eluser]
here is another xajax implementation xajax pagination I hope this will useful for you. Bye
[eluser]Đaяк Đaηтє[/eluser]
I don't undestand, I have the same situation, I make a pagination but I need to invoke a Javascript function in numeric links, I´m using JQuery, Can you post the complete script? Do I need to edit the Pagination Class? Thanks buddies!
[eluser]!Z[/eluser]
Hi in this function of this library http://codeigniter.com/wiki/Xajax_Pagination/ you will see how the javascript call is added into the links of the numbers. $this->function_to_call = "the function that you create in Javascript" Code: function create_ajax_links($text,$page=""){ Make Sense? |
Welcome Guest, Not a member yet? Register Sign In |