作成日: 2025/02/27 最終更新日: 2025/12/24
文書種別
不具合
状況
修正済み
詳細
クライアント側スクリプトのSetBackColorメソッド/SetForeColorメソッドでボタン型セルの背景色/文字色を変更しようとすると、ボタン型セルが設定されているセルの背景色は変化しますが、ボタン要素の背景色/文字色を変更できません。
回避方法
Service Pack 10(v10.0.4015.2013)で修正済み。
Service Pack 10を適用しない場合は、ボタン型セルのエディタに対して明示的にスタイルを設定することで回避できます。
function test() {
const spread = document.querySelector("#FpSpread1");
// spread.Cells(0, 0).SetBackColor("Red", true);
// spread.Cells(0, 0).SetForeColor("Blue", true);
// 回避策
var cell = spread.Cells(0, 0);
if (cell.GetCellType() == "ButtonCellType") {
var editor = spread.getEditor(cell);
if (editor != null) {
editor.style["backgroundColor"] = "Red";
editor.style["color"] = "Blue";
}
}
}