Note that there are some explanatory texts on larger screens.

plurals
  1. POError in ajax jquery pagination in CI
    text
    copied!<p>Got error in jquery pagination in codeigniter.</p> <pre><code> if per_page=5; total number 6 and total page 2 but the pagination like below Showing 6 to 6 of 6 | &lt; 1 2 But only 5 is shown and last one show in 2nd page. </code></pre> <p>Hi friends i am stuck in this bug.This show in every pages.Pls give me a solution to get correct pagination</p> <p>below code is using:</p> <pre><code> $config['base_url'] = site_url('settings/view_leave_reason_ajax/'); $config['total_rows'] = $this-&gt;leav-&gt;getLvReasonCount(); $config['per_page'] = 5; $config['anchor_class'] = 'ajax_links'; $config['show_count'] = true; $config['div'] = '#list_view'; $this-&gt;jquery_pagination-&gt;initialize($config); $page = ($this-&gt;uri-&gt;segment(3)) ? $this-&gt;uri-&gt;segment(3) : 0; $data["links"] = $this-&gt;jquery_pagination-&gt;create_links(); $data['page'] = $page; $data['result'] = $this-&gt;leav-&gt;getLvReason($config["per_page"], $page); </code></pre> <p>question regarding the below ci pagination:</p> <p><a href="https://github.com/neotohin/CodeIgniter-Ajax-pagination-Library" rel="noreferrer">https://github.com/neotohin/CodeIgniter-Ajax-pagination-Library</a></p> <p>view page:</p> <pre><code>&lt;?php if($result=="") {?&gt; &lt;tr style="height: 50px; background:#ffffff; font-weight: bold;"&gt; &lt;td colspan="5" style="width:50px;"&gt; No Details Exist &lt;/td&gt; &lt;/tr&gt; &lt;?php } if($result!="") { $c = $page+1; $col1[1]=""; $col1[2]="#d6e3f6"; $col=$col1[2]; foreach ($result as $row) { $did = $row['id']; ?&gt; &lt;tr style="height: 50px;background:&lt;?php echo $col;?&gt;;"&gt; &lt;td&gt;&lt;input type="checkbox" name="c1[]" value="&lt;?php echo $did;?&gt;" /&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $c;?&gt;&lt;/td&gt; &lt;td&gt;&lt;?php echo $row['department_name'];?&gt;&lt;/td&gt; &lt;td&gt; &lt;a class="fancybox fancybox.iframe" href="&lt;?php echo site_url()."/settings/department_edit/".$this-&gt;hrm-&gt;encData($row['id']); ?&gt;" &gt;&lt;img class="aicon" src="&lt;?php echo base_url().'/assets/images/edit.png';?&gt;" width="20" title="edit" style="margin-top:4px; margin-left:3px;"&gt;&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php $c=$c+1; if($col == $col1[1]) $col = $col1[2]; else $col = $col1[1]; } ?&gt; &lt;tr style="height: 50px; background:#ffffff; font-weight: bold;"&gt; &lt;td colspan="5" style="width:50px;"&gt; &lt;input type="button" value="Delete" class="btn_black" onclick="return chkdel()"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php }?&gt; &lt;tr style="height: 50px;"&gt;&lt;td colspan="4" style="text-align: right; padding-right:10px;"&gt;&lt;?php echo $links; ?&gt;&lt;/td&gt;&lt;/tr&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload