开发者

Knockoutjs: Expanding the SimpleGrid to Support Sorting

开发者 https://www.devze.com 2023-04-08 04:23 出处:网络
How would you modify the kno开发者_如何学Cckout.js simpleGrid plug-in to support column sorting?

How would you modify the kno开发者_如何学Cckout.js simpleGrid plug-in to support column sorting?

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


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


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)

0

精彩评论

暂无评论...
验证码 换一张
取 消