1
我们正在寻找一种方法来记录增强网格中的列在同一个网格内的某些列拖放操作后的顺序,由于网格布局在DnD操作后不会改变,所以我无法找到任何方法来获得列的序列。 有没有直接的方法呢? 否则,我们是否有与DnD相关的任何事件,可用于跟踪网格中列的顺序。如何在拖放(DnD)操作后获得增强网格列的新订单
我们正在寻找一种方法来记录增强网格中的列在同一个网格内的某些列拖放操作后的顺序,由于网格布局在DnD操作后不会改变,所以我无法找到任何方法来获得列的序列。 有没有直接的方法呢? 否则,我们是否有与DnD相关的任何事件,可用于跟踪网格中列的顺序。如何在拖放(DnD)操作后获得增强网格列的新订单
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;
}