使用jquery分页插件
我想使用这个插件,但我不知道它是否能满足我的所有需求要求。
我知道我必须使用 JSON 从服务器获取数据,然后在客户端使用它,对吗?现在,这很好,因为我只有很少的记录,但是当我有数千条时;一次性把所有数据都带过来方便吗?我想知道的是:
- 有什么办法可以查询 每次我按数据库 特定页码?我问 我认为这不是一个好的原因 一次性加载所有数据的想法, 是吗?
- 我曾经传递记录的id 本来要这样编辑
:
<td align="center">
<c:url value="edititem.htm" var="url">
<c:param name="id" value="${item.id}"/>
</c:url>
<a href="<c:out value="${url}"/>"><img src="images/edit.png" width="14" height="14" alt="edit"/></a>
</td>
但现在我不知道该怎么做。
我真的希望你能帮助我。
提前致谢。
I want to use this plugin, but I don't know if it'll meet all of my requirements.
I know I have to use JSON to fetch the data from the server and then use it at the client side, is that right?. For now, that's fine, because I only have very few records, but when I have thousands of ; will it be convenient to bring all the data at once? What I would like to know is :
- Is there any way to query the
database every time I press the
number of an specific page? I ask
this cause I don't think is a good
idea to load all the data in one go,
is it? - I used to pass the id of the record I
was going to edit like this
:
<td align="center">
<c:url value="edititem.htm" var="url">
<c:param name="id" value="${item.id}"/>
</c:url>
<a href="<c:out value="${url}"/>"><img src="images/edit.png" width="14" height="14" alt="edit"/></a>
</td>
but now I don't know not how to do it.
I really hope you can help me out.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
...我会尝试一下。这个怎么样?如果您查看演示页面的源代码,会发现有一个 member.js 文件,我认为这是演示的模拟数据。我有一个由插件使用的单变量“成员”。所以你是对的,ajax 调用就是你从服务器获取数据的方式。就我个人而言,我认为这很糟糕,因为它都是硬编码的:-(
来自文档:
...不过有两句话是个问题:
...在某些情况下,预加载内容可能无法启动,从而违背了使用分页的目的:-(因此您将自己滚动回调函数来获取数据集。
您是否尝试联系作者了解服务器端的信息交互样本?
... I'll give it a shot. How about this? If you look at the source of the demo page, there's a member.js file and I think that's the mock data for the demo. I has a one variable 'members' that's used by the plugin. So you're right, an ajax call would be how you need to get your data from the server. Personally I think that's a bummer since it's all hard coded :-(
From the documentation:
... 2 sentences are a problem though:
... pre loading content might be a non starter in some situations, defeating the purpose of using pagination :-( So you wold be on your own rolling the callback function to get the data sets.
Did you try contacting the author about server side interaction samples?