I'm building an HTML table via Javascript DOM, then initializing it with datatables, including hooking the click event to track the number of selected rows. Works as expected. When I want to refresh the data though, something happens to the click handler. The handler runs, the rows visually select / deselect, but the count of selected rows returns zero. I experimented with a number different concepts for initializing the datatable (i.e., avoiding a second initialization entirely, and using "destroy" or "retrieve"), but neither resolved the issue. Can someone point me in the right direction?
live.datatables.net/yaganalo/1/edit
(Show the console, click some rows, click the "refresh" button, then click rows again.)