Column moved, bad index returned

If i sort grid i get

grid.attachEvent(“onBeforeSorting”, function(ind,type,direction){
//your code here
return false;

ind = 1

if i move column 1 after that i get

ind = 2

it is impossible to sort on server side based on index which is not fixed?

how to solve this?

how can i get fixed index of column as i get data

i solved this that i stored in userdata original databaseindex and compare actual columnid with this data and send to sort this database index