Knockoutjs:扩展 SimpleGrid 以支持排序
如何修改 knockout.js simpleGrid 插件 以支持列排序?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 https://shiljopaulson.github.io/Knockout.simpleSortableGrid/ 中找到的 KnockoutSimpleSortableGrid 和它包含样本
Use KnockoutSimpleSortableGrid found at https://shiljopaulson.github.io/Knockout.simpleSortableGrid/ and it contains samples in it
我对提供的代码进行了修改。
我已经修改了 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)