title: Find Index of Column(s) after it has been Moved
body: <p>We are using DHTMLX Grid. Need some help, please.</p>
  
  <p>I have a table and each columns (has filter/dropdown) are allocated an id eg. fac, date, sel, loc, tag ... etc</p>
  
  <p>We have hard coded the index of columns to set and get the cookie elsewhere.</p>
  
  <pre><code>    function doInitGrid(){  
  
  mygrid.setColumnIds("fac,date,sel,loc,tag");  //set ids   
  mygrid.attachEvent("onFilterStart",function(ind,data)
                              {
  setCookie("Tray_fac_filter",mygrid.getFilterElement(0).value,365); //column index 0
  setCookie("Tray_loc_filter",mygrid.getFilterElement(3).value,365);//column index 3
  setCookie("Tray_tag_filter",mygrid.getFilterElement(4).value,365); //column index 4
  
  mygrid.getFilterElement(0).value = getCookie("Tray_fac_filter")
  mygrid.getFilterElement(3).value = getCookie("Tray_dep_filter")
  mygrid.getFilterElement(4).value = getCookie("Tray_prg_filter")
  });
  }
  </code></pre>
  
  <p>But when the columns are moved, the problem arises as the index of the column changes yet it is set in setCookie /getCoookie</p>
  
  <p>DHTMLX allows to get the index of the id using -- </p>
  
  <pre><code>var colInd = grid.getColIndexById(id); 
  eg: var  colInd = grid.getColIndexById(date); // outputs 1.
  After moving the date column to the end -- fac, sel, loc, tag, date // it will output 4.
  </code></pre>
  
  <p>However, we have about 14 columns that can be moved/rearranged and I could use the </p>
  
  <pre><code>var colInd = grid.getColIndexById(id); 15 times
  
  var facInd = grid.getColIndexById("fac");
  var dateInd = grid.getColIndexById("date");
  var selInd = grid.getColIndexById("sel");
  var locInd = grid.getColIndexById("loc";
  var tagInd = grid.getColIndexById("tag");
  </code></pre>
  
  <p>and put those variables in the set/get cookie. I was thinking if there was a better way.</p>
  
  <p>To understand the code better, I have put the minimised version of the code in fiddle.</p>
  
  <p><a href="http://jsfiddle.net/19eggs/s5myW/2/" rel="nofollow">http://jsfiddle.net/19eggs/s5myW/2/</a></p>