knockout-table plugin for fast table generation

1,056 views
Skip to first unread message

Michael Best

unread,
Aug 21, 2012, 12:21:19 AM8/21/12
to knock...@googlegroups.com
Anyone who's used Knockout's foreach binding to generate data tables has probably noticed that it's quite slow. Some time ago, I created the repeat binding to help in cases where foreach was too slow (it's about twice as fast). But now, I've created a new binding called simply table that is ten times faster than using nested foreach for tables.

Information, examples, and code is available through Github: https://github.com/mbest/knockout-table

Please note that this plugin is alpha-level. Please try it out and let me know about any bugs you find or suggestions and comments you have.

Thanks,
Michael

rpn

unread,
Aug 21, 2012, 9:04:33 AM8/21/12
to knock...@googlegroups.com
That is really excellent work MIchael!

Michael Best

unread,
Aug 31, 2012, 6:56:35 AM8/31/12
to knock...@googlegroups.com
I've made some updates to the table binding. There are a few bug fixes and some important interface changes. Specifically, you can now specify the rows and columns in a consistent way, and the table data can be given directly, without an object-literal wrapper. Again, the link is  https://github.com/mbest/knockout-table 

Thanks,
Michael

rpn

unread,
Aug 31, 2012, 8:25:12 AM8/31/12
to knock...@googlegroups.com
Again, really nice plugin Michael!  I think this could be really useful to lots of people.

Casey Corcoran

unread,
Aug 31, 2012, 1:30:53 PM8/31/12
to knock...@googlegroups.com
Ooh, can't wait to try this out. I've been considering something like this, I have a need for a dynamic tabular layout based on some responsive design and this might fit the bill...

Thanks for sharing!

Casey Corcoran

mcgra...@gmail.com

unread,
May 18, 2016, 3:20:49 PM5/18/16
to KnockoutJS
This has solved one of our problems.  It is very fast.  Is there a way to programatically add click bindings within this ?

Michael Best

unread,
May 20, 2016, 9:31:14 PM5/20/16
to KnockoutJS
It doesn't support click bindings. Instead, you could use delegated event handling. Put a click handler on the table element and then programmatically determine what was clicked. Or use jquery's "on" function.
Reply all
Reply to author
Forward
0 new messages