jQuery Tablesorter w/ Pager 插件预加载图像

发布于 2024-11-27 23:54:38 字数 332 浏览 8 评论 0原文

我也使用 TableSorter jQuery 插件和相关的 Pager 插件。我的 MySql 查询结果显示在此表中。问题是,在我从查询中检索评级结果后,我使用该值通过 Star rating jQuery 插件显示 5 星级评级。问题是我在设计一个能够按评级排序的解析器时遇到了麻烦,并且在星星预加载方面也遇到了问题。我的意思是,由于涉及页面并且能够更改显示的结果数量,因此“隐藏”结果不会加载星星。因此,如果我更改显示的结果数量或遍历到另一个页面,则仅显示单选按钮而不是星形图像。有人可以帮助我让图像预加载所有结果或找到一种方法让图像以另一种方式显示吗?这是一个非常紧迫的问题,阻碍了项目的完成,因此我们感谢任何帮助。

谢谢!!

I am using the TableSorter jQuery plugin with associated Pager plugin as well. I am having MySql query results displayed in this table. The thing is, after I retrieve a rating result from the query, I use this value to display a 5 star rating using a Starrating jQuery plugin. The issue is that I am having trouble designing a parser to be able to sort by rating as well as having issues with the stars preloading. I mean that since there are pages involved and ability to change amount of results displayed, the "hidden" results do NOT load the stars. So if I change amount of results displayed or traverse to another page, only radio buttons are displayed instead of the star images. Can someone please assist me in getting the images to either preload for ALL results or discover a way to get the images to display another way?? This is a very pressing issue holding up the completion of a project so ANY help is appreciated.

Thanks!!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枉心 2024-12-04 23:54:39

问题在于分页器插件根据缓存的数据重建整个表,因此这就是为什么在更改页面时您看到的只是单选按钮。

我最近在 github 上分叉了 tablesorter 插件 的副本,并且实际上包含了一些触发事件寻呼机插件。如果您查看 寻呼机演示页面,您将看到触发的事件显示在顶部。您需要做的就是在“pagerComplete”事件发生时重新应用 star 插件。像这样的东西:

$('table').bind('pagerComplete', function(){ 
  // reapply the stars plugin
  $(this).stars();
});

The problem is that the pager plugin rebuilds the entire table from its cached data, so that's why all you see are radio buttons when changing pages.

I've recently forked a copy of the tablesorter plugin on github and I've actually included some triggered events for the pager plugin. If you look at the pager demo page, you'll see the triggered events display across the top. All you need to do then is to reapply the stars plugin when the "pagerComplete" event occurs. Something like this:

$('table').bind('pagerComplete', function(){ 
  // reapply the stars plugin
  $(this).stars();
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文