grid template/objects

My project is using many grids which all share basic functionality, for the most part each grid is initialized the same way except where column names are different or need special cases. What is the best way to reduce the redundancy of the initialization? Is there a way to add custom functions to a grid such as grid.customFunction1()? The following is what I’m doing but it seems like there might be another way.

function myfunc(grid)



Your solution is good enough and works well.
No need to change anything.