jQWidgets Forums

jQuery UI Widgets Forums Angular PivotGrid

This topic contains 2 replies, has 2 voices, and was last updated by  Peter Stoev 7 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    PivotGrid Posts
  • PivotGrid #96428

    Gary
    Participant

    I started working with the PivotGrid and everything worked with the examples. When I changed over to pulling data from an API it seems that the DataAdapter for the PivotGrid executes before the DataAdapter is complete. If I just take the JSON and input it in component the latency is removed and everything works. Any suggestions?

    I’m running JQWIDGETS 5.3.2 Angular 4.3.5.

    Thanks, Gary.

    I get the following error:

    vendor.bundle.js:93537 ERROR TypeError: Cannot read property ‘expand’ of undefined
    at CandidatePivotComponent.webpackJsonp…/../../../../src/app/test/candidatespivot.component.ts.CandidatePivotComponent.ngAfterViewInit (main.bundle.js:4983)
    at callProviderLifecycles (vendor.bundle.js:103706)
    at callElementProvidersLifecycles (vendor.bundle.js:103681)
    at callLifecycleHooksChildrenFirst (vendor.bundle.js:103665)
    at checkAndUpdateView (vendor.bundle.js:104770)
    at callViewAction (vendor.bundle.js:105127)
    at execEmbeddedViewsAction (vendor.bundle.js:105085)
    at checkAndUpdateView (vendor.bundle.js:104763)
    at callViewAction (vendor.bundle.js:105127)
    at execComponentViewsAction (vendor.bundle.js:105059)

    PivotGrid #96429

    Gary
    Participant

    Update…..

    Please disregard the expand error I mention earlier. It is the result of data not making it to the pivot data source. I believe my question is, how
    to get the data from the DataAdapter to the pivot data source. I’m not sure how to construct the Binding complete function on the DataAdapter so I can ensure the data is loaded before executing the pivot data source.

    I’m sure I just not understanding something. A little different twist here with the need to transform the data.

    Thanks,
    Gary

    PivotGrid #96445

    Peter Stoev
    Keymaster

    The dataAdapter have a callback function called, loadComplete. It is called when the data source is loaded within the dataAdapter either through AJAX or local data source. Something like that:

       var dataAdapter = new jqx.dataAdapter(source, {
                    loadComplete: function () {
                        // get data records.
                        var records = dataAdapter.records;
                        var length = records.length;
                    }
                });

    Hope this helps.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.