私は剣道の子グリッドを持っています。それはいくつかの行があります。各行にはいくつかのセルがあります。私は最初の行以外のセルの値を変更する場合、私は対応する最初の行のセルの値を取得し、いくつかの検証を行う必要があります。グリッドのすなわち、イベントを保存し、必要なときgrid.editCell()メソッドを使用するためのハンドラを追加します剣道グリッドの他のセルをクリックするのを防ぐ
コード
var $container = $(container),
tdIndex = $container.index(),
$correspondingCell = $container.closest("tbody").find("tr:first td:eq(" + tdIndex + ")");
$('<input maxlength="9" data-bind="value:' + options.field + '"/>')
.appendTo($container)
.kendoNumericTextBox({
format: "0.####",
decimals: 0,
min: 0,
spinners: false,
change: function (e) {
//debugger;
CalculateFormatWeeks(options.model);
var uid = options.model.uid;
var cellinx = $('#kenTitleFormatsGrid .k-edit-cell')[0].cellIndex;
var row = $("#kenTitleFormatsGrid tbody").find("[data-uid='" + uid + "']");
var cell = row.children().eq(cellinx);
cell.css("font-style", "normal");
console.log("From Cell", $correspondingCell.text());
if (Number($correspondingCell.text()) == 0) {
alert("There is no daily GBO exists to enter the format gross. Please add the daily GBO data before proceeding");
}
}
}).off("keydown");
セルの変更イベントでこの条件を記述する必要があります。このセルの値が変更されると、週と週末の列の値を静的に変更するので、より多くの時間を実行します。 – Gowthami
e.valuesとif-statementに対するチェックを追加して、必要なときだけ処理します。 saveイベントはすべてのセルで発生するので、必要なセルに対して適切な処理を行い、気にしないセルでは何もしないロジックを追加する必要があります。 –