PureJS CollectionView 생성 오류 문의
페이지 정보
작성자 dounur 작성일 2022-11-04 12:40 조회 854회 댓글 0건본문
관련링크
안녕하세요.
CollectionView 생성 시 오류가 발생하였는데 원인을 알 수 없어 문의 드립니다.
1. 오류 메세지
Uncaught TypeError: wijmo.CollectionView is not a constructor
at fn_getCalculatedView (test_collectionview.html:28:16)
2. 소스
<script src="/GSCM/wijmo/controls/wijmo.min.js"></script>
<script>
function on_init()
{
fn_getCalculatedView();
}
function getData() {
return [
{ product: 'Banana', brand: 'Chiquita', unitPrice: 45.95, qty: 12, discount: .08 },
{ product: 'Apple', brand: 'Granny', unitPrice: 65.95, qty: 23, discount: .02 },
{ product: 'Orange', brand: 'Sunkist', unitPrice: 52.95, qty: 16, discount: .04 },
{ product: 'Grape', brand: 'Pinot', unitPrice: 83.95, qty: 8, discount: .0 },
{ product: 'Watermelon', brand: '', unitPrice: 13.95, qty: 14, discount: .05 },
{ product: 'Mango', brand: 'Ganesh', unitPrice: 38.95, qty: 19, discount: .15 },
];
}
function fn_getCalculatedView() {
let cv = new wijmo.CollectionView(getData());
/*
return new wijmo.CollectionView(getData(), {
calculatedFields: {
// function-based expressions
fullName: ($) => [$.brand, $.product].join(' '),
allCaps: ($) => $.fullName.toUpperCase(),
totalPrice: ($) => ($.unitPrice * $.qty) * (1 - $.discount),
tax: ($) => $.totalPrice * 0.12,
// string-based expressions
fullNameStr: '[$.brand, $.product].join(" ")',
allCapsStr: '$.fullNameStr.toUpperCase()',
totalPriceStr: '($.unitPrice * $.qty) * (1 - $.discount)',
taxStr: '$.totalPriceStr * 0.12',
}
});
*/
}
댓글목록
등록된 댓글이 없습니다.