It’s my personal opinion, but it’s better to use only the plain html in the contents that will be updated by ajax. It tends to make things messy when you have included scripts in those contents.
I would use an independent javascript function outside the grid to initialize those attributes in the grid. And use ‘afterAjaxUpdate’ to re-initialize them after the ajax calls.