Knockoutjs: Expanding the SimpleGrid to Support So

2019-04-02 09:43发布

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/

2条回答
我命由我不由天
2楼-- · 2019-04-02 10:00

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)

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-04-02 10:08

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

查看更多
登录 后发表回答