안녕하세요 그레이프시티입니다.
먼저 문의에 대한 답변이 지연된 점 죄송합니다.
CellMaker의 MakeImage에 예외를 처리하는 직접적인 콜백 메서드는 없지만 attribute 속성에서 이미지 URL을 찾지 못한 경우, 'onerror' 이벤트를 트리거하는 속성을 추가하실 수 있습니다. 아래 코드를 참고하여 주시길 바랍니다. cellMaker 함수에서 이미지가 없는 경우, 다른 이미지가 나올 수 있도록 처리하고 있습니다.
function init() {
new FlexGrid('#theGrid', {
(...)
// images
{
binding: 'img',
header: 'Images',
cssClass: 'cell-img',
cellTemplate: cellMaker()
}
],
itemsSource: getData(1000)
});
}
function cellMaker() {
return CellMaker.makeImage({
label: 'image for ${item.country}',
attributes: {
onerror:
"this.onerror=null;this.src='https://placeimg.com/200/300/animals';"
}
});
}
다른 궁금한 점이 생기면, 문의 주시기 바랍니다.
감사합니다.
그레이프시티 드림
* 그레이프시티(GrapeCity)는 개발자를 위하여 ComponentOne(컴포넌트원), Spread(스프레드), ActiveReports(액티브리포츠), SpreadJS(스프레드JS), Wijmo(위즈모)와 같은 엑셀 스프레드시트 리포팅 그리드와 차트 등 다양한 종류의 .NET JavaScript(자바스크립트) 컴포넌트 툴을 생산하고있는 개발툴 전문 회사 입니다.