
In my datatable application I find myself repeating code in control after control so that after any changes in either the rows or the columns that the user instigates, the width of each column is adjusted based on the maximum length of all visible strings in that column.
Is there some way for me to write code blocks that can be inserted into the CustomJS before runtime, or to make blocks that can be called from within CustomJS at runtime?
As an aside, if there is an easier way to get dynamic width on the table columns, please let me know. I couldn’t find it and rolled my own.

