기타 Javascript SetCellData
추천0 비추천 0
페이지 정보
작성자 김끄으으비 작성일 2023-08-08 11:00 조회 332회 댓글 0건제품 버전 : 자바스크립트 라이브러리
본문
관련링크
안녕하세요 위즈모 데이터 셋팅 관련하여 질문 드립니다, 해당 할인율을 입력 후 체크박스를 풀면 0 % 지로 돌아가게 만들었는데, 안에 있는 데이터는 0%이지만 화면에 보여지는 부분은 100%로 표출되고 항상 다른 헤더를 클릭해야지만 0% 가고 있습니다. 이와 관련하여 어떠한 부분을 고쳐야 하는지 가르쳐 주시면 감사하겠습니다.
grid.hostElement.addEventListener('click', function(e) {
console.log('onClick');
var discountColumn = grid.getColumn('discountPer');
var ht = grid.hitTest(e.pageX, e.pageY);
var col = ht.col;
var row = ht.row;
grid._focus = false;
console.log(ht.panel);
console.log(ht.col);
console.log(ht.row);
var rowdata = ht.panel.rows[row]._data;
console.log(ht.panel.rows[row]._data);
console.log(e.target.type);
console.log(123,e.target.chekced);
console.log(456,e.target.unchekced);
if(rowdata != null){
if(rowdata.ProductCode ==''){
var item = [];
}
}
if (ht.panel === grid.cells && e.target.type === undefined) {
var item =[];
item.push(ht.panel.rows[row].dataItem);
console.log("Wijmo item :: " + JSON.stringify(item));
}
if(e.target.type =='button'){
rowIndexforRemove = row;
requestQty = ht.panel.rows[row].dataItem.itemCount;
const mapRow = {
'rowIndexforRemove': rowIndexforRemove,
'requestQty': requestQty
};
LCC.sendMessage({'type':'getRowIndex', mapRow});
}
if (e.target.type === 'checkbox') {
var selected = grid.selectedRows;
console.log('selecteselectedd',selected);
var updatedRowItem = [];
if(rowdata.checkDiscount && (ht.col == '9')){
if(rowdata.freeSupplyYN == "Y"){
freeSupply = true;
}
discountColumn.visible=true;
// selected.dataItem.discountPer=100+'%';
// selected.dataItem.checkDiscount = true;
grid.rows.forEach(rows => {
//rows._data.checkDiscount = true;
//rows._data.discountPer = 100+'%';
rows.dataItem.checkDiscount = true;
});
checkedDiscountList.push(item);
}else if(!rowdata.checkDiscount && (ht.col == '9')){
selected.forEach(rows => {
rows._data.checkDiscount = false;
rows._data.discountPer = 0+'%';
});
checkedDiscountList.shift();
}
grid.rows.forEach(rows => {
if(rows.dataItem.checkDiscount){
updatedRowItem.push(rows.dataItem);
}
});
LCC.sendMessage({'type':'updateDiscountRate', updatedRowItem});
}
console.log('checkedDiscountList.length'+ JSON.stringify(updatedRowItem));
LCC.sendMessage({'type':'onclick', item});
});
댓글목록
등록된 댓글이 없습니다.