You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
The column can't reorder When Grid declared from ColumnReorder and ColumnSet.
The reason for this weakness in ColumnReorder.renderHeader uses grid.columnSets, but the Grid.renderHeader uses grid.subRows.headerRows.
In ColumnSet:
function getColumnSetSubRows(subRows, columnSetId, startRow) {
// Builds a subRow collection that only contains columns that correspond to
// a given column set id.
if (!subRows || !subRows.length) {
return;
}
var subset = [],
idPrefix = columnSetId + '-',
i = startRow || 0,
numRows = subRows.length;
for (; i < numRows; i++) {
var row = subRows[i];
var subsetRow = [];
subsetRow.className = row.className;
for (var k = 0, numCols = row.length; k < numCols; k++) {
var column = row[k];
// The column id begins with the column set id.
if (column.id != null && column.id.indexOf(idPrefix) === 0) {
column.columnSetId = columnSetId;
subsetRow.push(column);
}
}
subset.push(subsetRow);
}
return subset;
}
In ColumnReorder:
renderHeader: function () {
function makeDndTypePrefix(gridId) {
return 'dgrid-' + gridId + '-';
}
var dndTypePrefix = makeDndTypePrefix(this.id),
csLength, cs;
this.inherited(arguments);
// After header is rendered, set up a dnd source on each of its subrows.
this._columnDndSources = [];
/// 保持与 Grid.renderHeader 和 _createHeaderRowCell 一致,
/// 增加使用 this.subRows.headerRows
if (this.columnSets) {
// Iterate columnsets->subrows->columns.
if(this.subRows && this.subRows.headerRows){
for (cs = 0, csLength = this.columnSets.length; cs < csLength; cs++) {
rias.forEach(getColumnSetSubRows(this.subRows.headerRows, cs, 1), function (subRow, sr) {
this._initSubRowDnd(subRow, dndTypePrefix + cs + '-' + sr);
}, this);
}
}else{
for (cs = 0, csLength = this.columnSets.length; cs < csLength; cs++) {
rias.forEach(this.columnSets[cs], function (subRow, sr) {
this._initSubRowDnd(subRow, dndTypePrefix + cs + '-' + sr);
}, this);
}
}
}
else {
// Iterate subrows->columns.
rias.forEach(this.subRows, function (subRow, sr) {
this._initSubRowDnd(subRow, dndTypePrefix + sr);
}, this);
}
}
The text was updated successfully, but these errors were encountered:
Hi,
The column can't reorder When Grid declared from ColumnReorder and ColumnSet.
The reason for this weakness in ColumnReorder.renderHeader uses grid.columnSets, but the Grid.renderHeader uses grid.subRows.headerRows.
In ColumnSet:
In ColumnReorder:
The text was updated successfully, but these errors were encountered: