Button and associated event only present on first page of results

Button and associated event only present on first page of results

coopcoop Posts: 1Questions: 0Answers: 0
edited February 2013 in General
http://debug.datatables.net/ajefax

Hello,

I've inherited a datatables instance that has recently started running more slowly due to the # of rows involved. We'd like to set bDeferRender: true, and indeed, this improves performance immensely. However, there's a button on each row that's used to toggle the edit state for the current row, and the button only works as intended (and has the proper style) for the first page of results that renders at load when bDeferRender is on.

Other libraries in play:
* backbone
* underscore
* jquery-ui

I know this is probably a job for .live() (or I guess .on() now), but I think the way the table/rows are constructed is (so far) impeding that from working.

The code is all available online, although unfortunately the actual production instance is not:

https://hg.mozilla.org/build/tools/file/b5af3a9a3759/lib/python/slavealloc

Here are some specific pointers:

Initial render function for the table:
https://hg.mozilla.org/build/tools/file/b5af3a9a3759/lib/python/slavealloc/www/js/views.js#l29

Where the problem column is initially added:
https://hg.mozilla.org/build/tools/file/b5af3a9a3759/lib/python/slavealloc/www/js/views.js#l60

Render function for each row where the button is styled:
https://hg.mozilla.org/build/tools/file/b5af3a9a3759/lib/python/slavealloc/www/js/views.js#l140

The toggleEdit function that isn't being perpetuated:
https://hg.mozilla.org/build/tools/file/b5af3a9a3759/lib/python/slavealloc/www/js/views.js#l166

Any help is appreciated while I continue muddling through this.

cheers,
--
coop
This discussion has been closed.