开发者

How to get the new order for enhanced grid columns after a Drag and Drop(DnD) operation

we were looking f开发者_C百科or a way to record the order of the columns in the enhanced grid after some column drag and drop operations within the same grid, since the layout of the grid does not change after a DnD operation, I am not able to find any way to obtain the sequence of columns. Is there any direct way for this? Or otherwise, do we have any events associated with DnD which one can use to keep track of sequence of columns in the grid.


function getHeaderDetails(lookUpAttribute)
{
 //returns the attribute of the header cells in the order in which they are
 //for example dnd cols-lookUpAttribute="field"  returns the column field you would want -   //preferably unique identifiers of the column
  var currentColumnOrder=[];
  var i = 0, views = advancedGrid.views.views;
  for(; i < views.length; i++){
   cells = views[i].structure.cells;       
   for(var index=0 ; index<cells.length; index++){      
    if (cells[index])
    {
     for (var key in cells[index]  )
     {        
      var cellObject=cells[index][key];
      //if(this.grid.rowSelector){

      //first one is always the selection box column
      //TODO change the check condition if rowselector exist
      //if (key!=="0")
      //{
       currentColumnOrder.push(cellObject[lookUpAttribute]);
      //}                         
     }
    }       
   }
  }
  return currentColumnOrder;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜