Knockoutjs:扩展 SimpleGrid 以支持排序

发布于 2024-12-06 13:58:43 字数 267 浏览 1 评论 0原文

如何修改 knockout.js simpleGrid 插件 以支持列排序?

我有以下代码: http://jsfiddle.net/NaveenVelaga/QSRBR/9/

How would you modify the knockout.js simpleGrid plug-in to support column sorting?

I have got the following code: http://jsfiddle.net/NaveenVelaga/QSRBR/9/

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

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

发布评论

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

评论(2

独留℉清风醉 2024-12-13 13:58:43

使用 https://shiljopaulson.github.io/Knockout.simpleSortableGrid/ 中找到的 KnockoutSimpleSortableGrid 和它包含样本

Use KnockoutSimpleSortableGrid found at https://shiljopaulson.github.io/Knockout.simpleSortableGrid/ and it contains samples in it

雪化雨蝶 2024-12-13 13:58:43

我对提供的代码进行了修改。

我已经修改了 simpleGrid 代码以期望列数据中具有排序功能。
这样我们就可以连接模板以通过提供的函数对点击进行排序。

http://jsfiddle.net/QSRBR/39/

这是一个简单的解决方案,需要扩展包括双向排序逻辑
(第二次单击以相反方向排序)

I have had a fiddle with the supplied code.

I have modified the simpleGrid code to expect a sorting function in the column data.
This way we can wire up the template to sort on click via the supplied function.

http://jsfiddle.net/QSRBR/39/

This is a simple solution which needs to be expanded to include bi directional sorting logic
(second click sorts in reverse direction)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文