Insert Column in middle of Grid

How to insert column in Grid dynamically in middle and reindex other columns? I tried using insertColumn => grid.insertColumn(0,‘View’);
But here we have to define index which will replace current column . I tried moveColumn to which won’t work. I am working in a tree grid structure

Just try to define a needed index in the first parameter of the insertColumn() method
https://docs.dhtmlx.com/api__dhtmlxgrid_insertcolumn.html
All other columns will be re-indexed according to the new position automatically.