Adding a column to a grid as first column

How to add a column as the first column ? The grid already created but later on, I want to add another column based on a condition and that should come as the first column.

  • Add the column as last
  • use getColumns go get all columns
  • shuffle like you need it
  • grid::setColumnOrder(newcolumns)