作成日: 2025/01/15 最終更新日: 2025/01/29
文書種別
不具合
状況
修正済み
詳細
Selectorを設定したFlexGridで、1列目のセルが編集状態になったときに、行ヘッダーに設定されたチェックボックスが消えて鉛筆アイコンが表示されます。
回避方法
この問題はバージョン5.20241.9で修正されました。
修正版を適用しない場合の回避方法は次の通りです。
1. editColumnIndexプロパティを-1に設定します。
theGrid.editColumnIndex = -1;
2. cloneFrozenCellsプロパティとfrozenColumnsプロパティが設定されている場合には上記1の方法では回避することができません。この場合は、下記のようにSelectorクラスの内部メソッドをオーバーライドする方法をご利用ください。
const SelectorClsNames = {
columnSelector: "wj-column-selector",
columnSelectorGroup: "wj-column-selector-group",
};
Selector.prototype["_formatItem"] = function (e: any, t: any) {
for (
var i = (t = new wjGrid.FormatItemEventArgs(
t.panel,
new wjGrid.CellRange(
t.range.row,
t.range.col,
t.range.row2,
t.range.col2
),
t.cell,
t.updateContent
))._rng;
i.col <= i.col2 && !t.getColumn().isVisible;
)
i.col++;
var o = t.getColumn(),
n = t.getRow(),
r = e.editRange;
if (
o &&
o == this._col &&
(t.panel.cellType !== wjGrid.CellType.Cell ||
!r ||
!r.contains(t.row, t.col)) &&
t.panel.rows != e.columnFooters.rows
) {
var l = t.cell,
s = "",
a: any = void 0,
c = wjGrid.CellFactory._tplCtx;
c.item = n.dataItem;
c.row = n;
c.col = o;
if (t.panel.rows == e.columnHeaders.rows) {
if (this._showCheckAll && t.range.bottomRow == t.panel.rows.length - 1) {
a = this._getRowChecked(0, e.rows.length - 1);
s =
SelectorClsNames.columnSelector +
" " +
SelectorClsNames.columnSelectorGroup;
}
} else if (this._isGroupRow(n)) {
var _ = n.getCellRange();
a = this._getRowChecked(_.row, _.row2);
s =
SelectorClsNames.columnSelector +
" " +
SelectorClsNames.columnSelectorGroup;
n.isSummary && (s += " " + "wj-state-disabled");
} else if (n.dataItem && !this._isBound) {
a = this._getRowChecked(t.row);
s = SelectorClsNames.columnSelector;
}
if (s) {
if (
this._isFixedCol ||
(this._isBound &&
this._isGroupRow(n) &&
o.aggregate &&
o.index > e.columns.firstVisibleIndex)
) {
var d = l.querySelector("." + wjGrid.CellFactory._WJC_COLLAPSE);
e.cellFactory.disposeCell(l);
l.textContent = "";
d && l.appendChild(d);
}
var u =
"" != this._ariaLabel
? ' aria-label="' + wjCore.evalTemplate(this._ariaLabel, c) + '"'
: ' aria-label="Select Row"',
h = wjCore.createElement(
'<label><input type="checkbox" class="' +
s +
" " +
wjGrid.CellFactory._WJC_CHECKBOX +
'" tabindex="-1"' +
u +
" /><span></span></label>"
),
m = h.querySelector("input");
wjCore.setChecked(m, a);
n instanceof wjGrid.GroupRow &&
(n as any).isSummary &&
wjCore.setAttribute(m, "disabled", !0);
wjCore.setAttribute(l, "aria-selected", !!a);
if (
this._isBound &&
(o.isReadOnly || e.selectionMode == wjGrid.SelectionMode.None)
) {
m.disabled = !0;
m.style.cursor = "default";
}
l.insertBefore(h, l.firstChild);
}
}
};