2010-11-24 3 views
1

同じグリッド内のいくつかの列のドラッグアンドドロップ操作の後に、拡張グリッドの列の順序を記録する方法を探していました。 DnD操作の後にグリッドのレイアウトが変更されないため、列のシーケンスを取得する方法を見つけることができません。 これに直接的な方法はありますか? それ以外の場合は、グリッド内の列の順序を追跡するために使用できるDnDに関連付けられたイベントがありますか?ドラッグアンドドロップ(DnD)操作後に拡張グリッド列の新しい順序を取得する方法

答えて

0
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; 
} 
関連する問題