作成日: 2014/10/03 最終更新日: 2014/10/03
文書種別
使用方法
詳細
GridViewにてEnterキーを押した際、1つ下のセルに移動するにはクライアント側のKeyPressイベントを使用します。KeyPressイベントにてEnterキーの押下を検出し、CurrentCellメソッドにてフォーカスを1つ下のセルに移動します。
◎サンプルコード (JavaScript)
◎サンプルコード (JavaScript)
$("#C1GridView1").closest(".wijmo-wijgrid").keypress(function (e, args) {
var currentCell = $("#C1GridView1").c1gridview("currentCell");
selectedCell = selection.selectedCells();
cellIndex = currentCell.cellIndex();
rowIndex = currentCell.rowIndex();
if (e.keyCode == 13) {
newCellIndex = cellIndex;
newRowIndex = rowIndex + 1;
cell = new $.wijmo.wijgrid.cellInfo(newCellIndex, newRowIndex);
range = new $.wijmo.wijgrid.cellInfoRange(cell, cell);
}
$("#C1GridView1").c1gridview("currentCell", newCellIndex, newRowIndex);
$("#C1GridView1").c1gridview("doRefresh");
$("#C1GridView1").focus();
});
var currentCell = $("#C1GridView1").c1gridview("currentCell");
selectedCell = selection.selectedCells();
cellIndex = currentCell.cellIndex();
rowIndex = currentCell.rowIndex();
if (e.keyCode == 13) {
newCellIndex = cellIndex;
newRowIndex = rowIndex + 1;
cell = new $.wijmo.wijgrid.cellInfo(newCellIndex, newRowIndex);
range = new $.wijmo.wijgrid.cellInfoRange(cell, cell);
}
$("#C1GridView1").c1gridview("currentCell", newCellIndex, newRowIndex);
$("#C1GridView1").c1gridview("doRefresh");
$("#C1GridView1").focus();
});
旧文書番号
80974