예, 나는 ... 당신
가 afterChange 이벤트를 사용하는 것과 같은 이유로 정확히 이런 짓을했는지
afterChange: function (changes, source) { AfterChange(changes, source); }
... 당신이 ...
다른 셀의 값을 변경할 수 있습니다
function AfterChange(Changes, Source) {
if (Source === 'loadData') {
return; //don't do anything on load
}
var rowIndex = 0, columnID = 1, oldTextVal = 2, newTextVal = 3, ntv = '', nv = '';
$(Changes).each(function() {
if (this[columnID] === 'RegionID') {
//Make sure nothing else happens when these columns are set through below, to avoid circular references
}
else if (this[columnID] === 'RegionName') {
ntv = this[newTextVal];
//I have a dropdown used for filtering which has the id as value where I get the id from
nv = $('#RegionsFilterDropdown option').filter(function() { return $(this).text() === ntv; }).val();
$container.handsontable('setDataAtCell', this[rowIndex], 12, nv);
}
});
}
이 정보가 도움이되기를 바랍니다.