I'm using a dojox.DataGrid in Dojo 1.8, and each of the rows has a button that I attach an onclick handler to. Up to 25 rows, I can easily attach the onclick event to each button this way:
dojo.connect(dojo.byId('button1'), 'onclick', this, 'callback')
However, when there are more than 25 items in the store, the 26th+ rows are not written to the DOM yet, so the line above will fail for the 26th (and oddly attaches the event to the top level DOM element) since dojo.byId('button26') returns null. I know this is because of the paging feature of the DataGrid.
Is there any way to attach event handlers to all of the items in the store itself, or to "future" elements on the DOM that will be there when the DataGrid retrieves the next page? Thanks!