作成日: 2024/12/11 最終更新日: 2025/03/14
文書種別
制限事項
詳細
LayoutDefinitionを使用して最初の列にwidthを指定した際、colspan=1の場合、widthに指定した列幅で表示されません。
例:
1のセルと4のセルは同じindexの列として扱われます。ここで、セルが同じ列に属している場合、後のセルによって設定された値が、最初のセルによって設定された値よりも優先されます。
そのため、列の幅は1で設定した値ではなく、4で設定した値が優先されます。
| 1 | 2 | 3 |
| 4 |
例:
1のセルと4のセルは同じindexの列として扱われます。ここで、セルが同じ列に属している場合、後のセルによって設定された値が、最初のセルによって設定された値よりも優先されます。
そのため、列の幅は1で設定した値ではなく、4で設定した値が優先されます。
| 1 | 2 | 3 |
| 4 |
回避方法
下記のように内部の_bindColumnsメソッドを書き換えます。
import * as wjGrid from "@grapecity/wijmo.grid";
import { MultiRow } from "@grapecity/wijmo.grid.multirow";
MultiRow.prototype._bindColumns = function () {
for (
var e = this,
t = this.columnHeaders.rows,
o = this._layout,
r = this._hdrLayout,
n = (r ? r._rowsPerItem : this.rowsPerItem) + 1;
t.length > n;
)
t.removeAt(t.length - 1);
for (; t.length < n; ) t.push(new wjGrid.Row());
this._updateCollapsedHeaders();
this.columns.clear();
if (o && o._bindingGroups) {
var l =
"width,minWidth,maxWidth,binding,header,format,dataMap,name,aggregate,cellTemplate".split(
","
);
o._bindingGroups.forEach(function (t) {
for (
var _loop_1 = function (o) {
if (0 === t.cells.length) return "continue";
for (
var r = new wjGrid.Column(),
_loop_2 = function (e) {
var n = t.cells[e];
n.col == o &&
l.forEach(function (e) {
r[e] = r[e] == null && n[e] != null ? n[e] : r[e];
if (e === 'aggregate') r[e] = n[e] != null && n[e] !== r[e] ? n[e] : r[e];
});
},
n = 0;
n < t.cells.length;
n++
)
_loop_2(n);
e.columns.push(r);
},
o = 0;
o < t._colspanEff;
o++
)
_loop_1(o);
});
}
};