PureJS 데이터 포멧 지정 후, 해당 셀 값 수정 불가 확인요청드립니
페이지 정보
작성자 라레 작성일 2021-07-15 15:25 조회 3,635회 댓글 0건본문
관련링크
아래와같이 formatItem 지정 후, 해당 셀을 더블클릭 시 데이터 변경이 불가능하여
값변경이 가능하도록 데이터포멧을 지정하는 방법을 문의드립니다.
문의사항 1.
- 분류필드의 값에 따라 입출고수량 필드의 값(10)이 입고일경우 +10(파랑), 출고일경우 -10(빨강) 상태가 되도록 포멧 지정 필요
- 해당 필드의 값 수정 가능하도록 조치 필요 (아래방법으로 지정시 현재 수정 불가)
currentColumns = [
{ isReadOnly: true, width: 35, align:"center"},
{ binding: 'cateSarSeq', header: '시퀀스', isReadOnly: true, width: 0, align:"center" },
{ binding: 'cretDt', header: '일자', isReadOnly: true, width: 100, align:"center" },
{ binding: 'cretNm', header: '담당자', isReadOnly: true, width: 100, align:"center" },
{ binding: 'classifiCd', header: '분류', isReadOnly: false, width: 150, align:"center", dataMap: classifiList, dataMapEditor: 'DropDownList' },
{ binding: 'lCategyCd', header: '카테고리', isReadOnly: false, width: 150, align:"center", dataMap: lCategyList, dataMapEditor: 'DropDownList' },
{ binding: 'itemCd', header: '물품', isReadOnly: false, width: '*', align:"center", dataMap: itemList, dataMapEditor: 'DropDownList'},
{ binding: 'cost', header: '원가', isReadOnly: true, width: 100, align:"center" },
{ binding: 'sarQuantity', header: '입출고수량', isReadOnly: false, width: 150, align:"center"},
{ binding: 'returnQuantity', header: '반품수량', isReadOnly: false, width: 150, align:"center" },
{ binding: 'quantity', header: '재고수량', isReadOnly: true, width: 100, align:"center" },
{ binding: 'updtDt', header: '수정일자', isReadOnly: true, width: 100, align:"center" }
];
currentGrid = new wijmo.grid.FlexGrid('#currentGrid', {
autoGenerateColumns: false,
alternatingRowStep: 0,
columns: currentColumns,
itemsSource: currentView,
formatItem:function(s,e){
if (e.panel == s.cells) {
var col = s.columns[e.col];
if (col.binding == 'sarQuantity' || col.binding == 'returnQuantity') {
//셀 서식
var html;
var value = s.getCellData(e.row, e.col);
var classifiCd = s.getCellData(e.row, 'classifiCd');
/* //방법1
if(value != undefined && value != null && value > 0){
if(classifiCd == "S" || classifiCd == "RS"){
col.cellTemplate = '<span class="change_plus">+'+value;
}else if(classifiCd == "R" || classifiCd == "RR"){
col.cellTemplate = '<span class="change_minus">-'+value;
}
}
*/
//방법2
if(value != undefined && value != null && value > 0){
if(classifiCd == "S" || classifiCd == "RS"){
html = '<span class="change_plus">+'+value+'</span>';
}else if(classifiCd == "R" || classifiCd == "RR"){
html = '<span class="change_minus">-'+value+'</span>';
}
e.cell.innerHTML = html;
}
}
}
}
});
댓글목록
등록된 댓글이 없습니다.