如何使用codeigniter分页与jquery的ajax? [英] How to use codeigniter pagination with jquery's ajax?

查看:83
本文介绍了如何使用codeigniter分页与jquery的ajax?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计们,



如何使用分页制作ajax?我现在没有任何代码,但我的问题是我的其他分页的OFFSET值使用:

Hey guys,

How can I make ajax work with pagination? I dont have any codes right now but my problem is that the OFFSET value for my other pagination uses:

$this->uri->segment(3)



来识别OFFSET有多少数据。但由于ajax不会更改页面的URL,这意味着我不能再使用uri->段值了。有人知道如何解决这个问题吗?



谢谢,


to identify how much data to OFFSET. But since ajax wont change the url of the page, it means I cannot use the uri->segment value anymore. Anyone know how to approach this?

Thanks,

推荐答案

this-> uri->段(3)
this->uri->segment(3)



来识别OFFSET有多少数据。但由于ajax不会更改页面的URL,这意味着我不能再使用uri->段值了。有人知道怎么办吗?



谢谢,


to identify how much data to OFFSET. But since ajax wont change the url of the page, it means I cannot use the uri->segment value anymore. Anyone know how to approach this?

Thanks,


我能够解决这个问题:



(ThePageNo.1 -1)* per_page值,



假设我每页有5个项目

这种方式如果我去第三页,就意味着:

(3 -1)* 5 = 10.



所以偏移量将是10,这将跳过我表格中的前10行,然后调用第11到第15个数据。
I was able to make a work around:

(ThePageNo. -1)* the per_page value,.

Let's say I have 5 items per page
This way If I go to the third page,it means:
(3 -1)* 5 = 10.

So the offset will be 10, which will skip the first 10 rows in my table and then call the 11th to 15th data.


这篇关于如何使用codeigniter分页与jquery的ajax?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆