Problem to get column Id


I have a broblem with getting column Id.
When I move column to new place (for example: from Index 1 to Index 2) and then I want to get the column id by giving the current index and for some reason the “grid.getColumnId(index)” function don’t work and returns “undefined”.

for example: I have grid and column index 1 holds id 1…now I move It to index (place) 2 and I want to get the old Id (1).

how could I do this operation ?

Make sure that you didn’t missed to set the ids for columns: