PureJS calculatedField 를 추가한 이후 에러가 발생합니다.
페이지 정보
작성자 nxdev1 작성일 2024-01-25 18:30 조회 63회 댓글 0건본문
관련링크
안녕하세요.
grid에서 result1, result2, total_result 이름의 colum들을 계산된 필드로 사용하고 싶어서
calculatedFields: { result1: (aaa) => (aaa.insert1 * aaa.insert2 * 4.9) / (aaa.insert3), result2: (aaa) => (aaa.insert4 * aaa.insert5 * 4.9) / (aaa.insert6), total_result: (aaa) => (aaa.result1 + aaa.result2) / 2, }
위 코드를 맨 아래 코드에 추가한 이후에 이러한 타입 에러
(TypeError: 'ownKeys' on proxy: trap returned duplicate entries)
가 뜹니다.
어떻게 해결하면 좋을지 알려주시면 감사하겠습니다.
아래는 calculatedField를 사용한 코드입니다.
var grid = new wijmo.grid.FlexGrid('#lasGrid'); fetch('/getCalTable', { method: "POST", headers: { "Content-Type": "application/json", }, body: selected // String 타입의 변수 }).then(response => response.json()) .then(data => { grid.columns.clear(); var columns = [ { binding: 'insert1', header: '1-1' }, { binding: 'insert2', header: '1-2' }, { binding: 'insert3', header: '1-3' }, { binding: 'insert4', header: '2-1' }, { binding: 'insert5', header: '2-2' }, { binding: 'insert6', header: '2-3' }, { binding: 'result1', header: '1회 result' }, { binding: 'result2', header: '2회 result' }, { binding: 'total_result', header: '함량 평균' } ]; columns.forEach(column => { let col = new wijmo.grid.Column( column ); grid.columns.push(col); }) LasTD = new wijmo.collections.CollectionView(data, { trackChanges: true, calculatedFields: { result1: (aaa) => (aaa.insert1 * aaa.insert2 * 10) / (aaa.insert3), result2: (aaa) => (aaa.insert4 * aaa.insert5 * 10) / (aaa.insert6), total_result: (aaa) => (aaa.result1 + aaa.result2) / 2, } }); grid.itemsSource = LasTD; grid.newRowAtTop = true; });
댓글목록
등록된 댓글이 없습니다.