안녕하세요 그레이프시티입니다.
Selector가 추가된 그리드의 topLeft 셀을 ReadOnly로 변경하고 싶은 경우, formatItem 이벤트 및 요소에 클래스 추가/삭제할 수 있는 toggleClass를 이용하시면 됩니다.
셀로 나타내는 요소가 생성될 때 발생하는 formatItem 이벤트 내에서 topLeft 영역인지 확인 후, 해당 셀에 'wj-state-disbled' 클래스를 추가해주시면 ReadOnly 상태가 적용된 것을 확인하실 수 있습니다.
아래 코드를 참고하여 주시기 바랍니다.
import {toggleClass} from '@grapecity/wijmo';
(...)
initGrid(grid: FlexGrid) {
this.setGroups(true);
this.selector = new Selector(grid, {
itemChecked: () => {
this.selectedItems = grid.rows.filter(r => r.isSelected);
}
});
grid.formatItem.addHandler((s: any, e: wjcGrid.FormatItemEventArgs) => {
if (e.panel == s.topLeftCells) {
toggleClass(e.cell,"wj-state-disabled")
}
});
}
- toggleClass API 문서
- formatItem API 문서
관련하여 API 문서를 공유드리며 다른 궁금한 점이 생기면 문의주시기 바랍니다.
감사합니다.
그레이프시티 드림