일부 onChange
이벤트를 처리하는 함수가 있습니다. 이 함수는 셀의 내용을 확인하기 위해 다른 함수를 호출합니다. 잘못된 것이 있으면 셀의 색이 바뀌어야합니다. 경고가, 어떤 생각이 왜 트리거 있는데도,handsontable plugin에서 사용자 정의 렌더러 함수가 작동하지 않습니다.
function ErrorRenderer(instance, td, row, col, prop, value, cellProperties)
{
Handsontable.TextCell.renderer.apply(this, arguments);
console.log(row);
td.style.fontWeight = 'bold';
td.style.color = 'green';
td.style.background = '#CEC';
}
ErrorRenderer가 호출되지 않습니다 :
function Check(x, y)
{
var content = $editorTableContainer.handsontable('getDataAtCell', y, x);
var split = content.split(' ');
$.each(split, function (key, value) {
$.get('check.php?word=' + value, function (data) {
//blank if no error otherwise it returns an array of suggestions (only need to check if there is an error)
if (data) {
alert("test");
var meta = $editorTableContainer.handsontable('getCellMeta', y, x);
meta.renderer = ErrorRenderer;
}
});
});
return;
}
그리고 여기 내 간단한 ErrorRenderer입니까? 당신이 handsontable를 사용하는 경우
, 왜 당신은 그것의 기능 내장 사용하지 않는 당신에게
오프 주제 확인할 수 있습니다 FWIW, 예약에 유용한 JS 코드 컨벤션있다 생성자 함수에 대해서만 대문자로 된 함수 이름. http://javascript.crockford.com/code.html#names – alxndr
감사합니다. 나는 그 것을 알지 못했다. – Cornwell
아래의 대답에 대한 렌더링에 대한 의견보기 – PostureOfLearning