Simple Ajax paging with existing pagination lib & jQuery - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Simple Ajax paging with existing pagination lib & jQuery (/showthread.php?tid=20443) Pages:
1
2
|
Simple Ajax paging with existing pagination lib & jQuery - El Forum - 07-10-2009 [eluser]Berserk[/eluser] Step 1: edit existing pagination lib: a. Find: Code: var $query_string_segment = 'per_page'; Add below: Code: var $is_ajax_paging = FALSE; b. Find: Code: if ($num_pages == 1) Add below: Code: if($this->is_ajax_paging == TRUE) c. add '.$paging_function.' on all of a element you found in Pagination.php ex: Code: <a > Code: <a+'.$paging_function.'> //remove plus Step 2: config your paging in controller (similar with default paging config): if you want to use ajax paging just add Quote:$config['is_ajax_paging'] = TRUE; //default FALSE if don't, set it to FALSE Ex: Code: // Set pagination Step 3: Set your view: Exp: Code: <div id = 'display-content'> Step4 : create jQuery paging function Code: ajax_paging = function(){ Finish! --------------------- You can use both non-ajax paging and ajax paging at same time, no need to rewrite your code (just need change $config['is_ajax_paging'] to TRUE or FALSE ). Hope it will help (sorry for my bad english) Simple Ajax paging with existing pagination lib & jQuery - El Forum - 07-10-2009 [eluser]Unknown[/eluser] any demos? Simple Ajax paging with existing pagination lib & jQuery - El Forum - 07-10-2009 [eluser]mrliam69[/eluser] So does Code: <a+ href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close; become (without the plus after the a) Code: <a+ '.$paging_function.' href="'.$this->base_url.$i.'">'.$this->prev_link.'</a>'.$this->prev_tag_close; Simple Ajax paging with existing pagination lib & jQuery - El Forum - 07-11-2009 [eluser]Berserk[/eluser] @kurt: sorry, have no demo now @mrliam69: thanks Simple Ajax paging with existing pagination lib & jQuery - El Forum - 08-26-2009 [eluser]sihijau[/eluser] could you give me demo and download files with instruction, please? i'm newbie Simple Ajax paging with existing pagination lib & jQuery - El Forum - 08-26-2009 [eluser]sihijau[/eluser] could u give me demo and download files, please? i'm a newbie. thanks Simple Ajax paging with existing pagination lib & jQuery - El Forum - 10-30-2009 [eluser]jiahui[/eluser] hello, I followed exactly the explanation as Berserk described and applied it into my project. But I get this error msg: Parse error: syntax error, unexpected T_VARIABLE .... What is the problem on this line: Code: $this->pagination->initialize($config); Below is the scripting which I added into controller: Code: // Set pagination Simple Ajax paging with existing pagination lib & jQuery - El Forum - 11-05-2009 [eluser]charlie spider[/eluser] you forgot the semicolon ; after config['paging_function'] = 'ajax_paging' but you've probably figured that out by now. Simple Ajax paging with existing pagination lib & jQuery - El Forum - 11-07-2009 [eluser]Amzad Hossain[/eluser] http://tohin.wordpress.com/2008/08/12/codeigniter-ajax-pagination/ http://tohin.wordpress.com/2008/10/07/codeigniter-ajax-pagination-exampleguideline/ Simple Ajax paging with existing pagination lib & jQuery - El Forum - 12-01-2009 [eluser]ngocthai[/eluser] very good, thanks for share |