! 제품 버전을 정확하게 입력해 주세요.
제품 버전이 정확하게 기재되어 있지 않은 경우,
최신 버전을 기준으로 안내 드리므로
더욱 빠르고 명확한 안내를 위해
제품 버전을 정확하게 입력해 주세요!

CollectionView 생성 오류 문의 > Q&A | 토론

본문 바로가기

Wijmo

Q&A | 토론

PureJS CollectionView 생성 오류 문의

페이지 정보

작성자 dounur 작성일 2022-11-04 12:40 조회 854회 댓글 0건
제품 버전 : 5.20221.842_KR
컨트롤 이름 : CollectionView

본문

안녕하세요.

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',

            }

        });

    */

    }

  • 페이스북으로 공유
  • 트위터로  공유
  • 링크 복사
  • 카카오톡으로 보내기

댓글목록

등록된 댓글이 없습니다.

1 답변

PureJS Re: CollectionView 생성 오류 문의

추천0 이 글을 추천하셨습니다 비추천0 채택채택

페이지 정보

작성자 GCK다이애나 작성일 2022-11-04 13:37 댓글 0건

본문

안녕하세요 그레이프시티입니다.


문의 주신 내용에 대해 답변 드립니다.

전달해 주신 에러 내용 및 코드를 확인해 본 결과, CollectionView 클래스의 생성자를 불러 오는 경로가 잘못 지정되어 발생하는 에러로 보입니다.

아래의 코드와 같이 CollectionView 클래스를 생성하여 보시기 바랍니다.

let view = new wijmo.collections.CollectionView(getData());

만약 위의 코드를 이용하여도 에러가 발생하는 경우, 에러 내용과 함께 문의 주시면 확인 후 안내 드리도록 하겠습니다.


- CollectionView 개요(PureJS) 데모

- CollectionView API 문서


API 문서를 공유드리며 다른 궁금한 점이 생기면, 문의 주시기 바랍니다.


감사합니다.


그레이프시티 드림

댓글목록

등록된 댓글이 없습니다.

메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
메시어스 홈페이지를 통해 제품에 대해서 더 자세히 알아 보세요!
홈페이지 바로가기
이메일 : sales-kor@mescius.com | 전화 : 1670-0583 | 경기도 과천시 과천대로 7길 33, 디테크타워 B동 1107호 메시어스(주) 대표자 : 허경명 | 사업자등록번호 : 123-84-00981 | 통신판매업신고번호 : 2013-경기안양-00331 ⓒ 2024 MESCIUS inc. All rights reserved.