We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Reload data

Hello,

i have a little problem with reloading data in an PivotGrid.

Basically there´s no big magic behind the code, bot the Grid wont refresh the data.
My Version: Vol. 4

    $scope.testPivot = function () {
        $("#PivotGrid").ejPivotGrid({
/*
            locale: "de-DE", 
*/
            isResponsive: true,
            dataSource: {
                data: $scope.PivotData
            }
        });
        var pivotGrid = $('#PivotGrid').data("ejPivotGrid");
        $("#PivotSchemaDesigner").ejPivotSchemaDesigner(
            {
                pivotControl: pivotGrid,
                layout: ej.PivotSchemaDesigner.Layouts.Excel
            });
    };




Another problem, when i set the locale to "de-DE" i get following error:

TypeError: Cannot read property 'DragFieldHere' of undefined
    at Object.t.widget._getLocalizedLabels (http://localhost:52987/Scripts/Syncfusion/web/ej.web.all.min.js:10:7219469)
    at Object.t.widget._createGroupingBar (http://localhost:52987/Scripts/Syncfusion/web/ej.web.all.min.js:10:7255776)
    at Object.t.widget._populatePivotGrid (http://localhost:52987/Scripts/Syncfusion/web/ej.web.all.min.js:10:7191642)
    at Object.t.widget._load (http://localhost:52987/Scripts/Syncfusion/web/ej.web.all.min.js:10:7190953)
    at Object.t.widget._init (http://localhost:52987/Scripts/Syncfusion/web/ej.web.all.min.js:10:7187020)
    at Object.<anonymous> (http://localhost:52987/Scripts/Syncfusion/web/ej.web.all.min.js:10:17698)
    at n.fn.(anonymous function) [as ejPivotGrid] (http://localhost:52987/Scripts/Syncfusion/web/ej.web.all.min.js:10:18784)



Thank you in advance for your help!!

RI

11 Replies

RG Ramesh Govindaraj Syncfusion Team January 29, 2016 09:42 AM UTC

Hi Ruzic,

Thank you for using Syncfusion products.

We have prepared a PivotGrid(Pure JS) sample with the combination of PivotTable Field List, Angular and localization support. Please find the sample in the following link.

Sample Link:   http://www.syncfusion.com/downloads/support/forum/121819/ze/Sample-976560173

Regards,
Ramesh G.  


RI RI February 2, 2016 03:08 PM UTC

Hi Ramesh,

thank you for your reply but that doesn´t solve my problem.

In your sample is the pivot data static and it works perfect like that, but
i need the data to be dynamically. 

My data isn´t loaded at the moment when the pivotgrid is rendered.

Does the Pivotgrid not have something like:

var pivotGrid = $('#PivotGrid').data("ejPivotGrid");

pivotGrid.dataSource($scope.data);





RG Ramesh Govindaraj Syncfusion Team February 3, 2016 07:33 AM UTC

Hi Ruzic,

Thank you for contacting Syncfusion support.

We have created an incident to log a feature report on behalf of you. Our support engineer will assist you through incident. We request you to follow with the incident for further details.
 
https://www.syncfusion.com/account/login?ReturnUrl=/support/directtrac/incidents

Regards,

Ramesh G.



RI RI February 3, 2016 10:02 AM UTC

If anybody needs the same functionality like me,

here is my "dirty" way of fixing this problem

        $("#PivotGrid").remove();
        var pivotGrid = ej.buildTag("div#PivotGrid", "", { height: 600, width: "60%", "overflow": "auto", "float": "left", "overflow": "auto", "margin-top": "20px" })[0].outerHTML;
        $(pivotGrid).appendTo(".control");

        $("#PivotSchemaDesigner").remove();
        var schemaDesigner = ej.buildTag("div#PivotSchemaDesigner", "")[0].outerHTML;
        $(schemaDesigner).appendTo(".PivotSchema");



RG Ramesh Govindaraj Syncfusion Team February 4, 2016 10:20 AM UTC

Hi Ruzic,
 
Thanks for the update.
 
Regards,
Ramesh G.


DF dfiori February 15, 2016 04:05 PM UTC

I'm facing the same problem. When I change data at runtime the grid does not get updated.
I tried calling the base method again, but without success
.ejPivotGrid({
    dataSource: oDataSource,
});

Please fix this


RG Ramesh Govindaraj Syncfusion Team February 16, 2016 07:28 AM UTC

Hi Dfiori,

We have prepared a sample based on your requirement. Please find the sample in the following link.

Sample Link:  http://www.syncfusion.com/downloads/support/forum/121819/ze/Sample-1878433730

NOTE:
Initially PivotGrid and PivotTable Field List won’t be rendered. Later when we click a button “Load data”, widgets would be rendered.

Regards,
Ramesh G.



RI RI February 23, 2016 03:28 PM UTC

Hello,

i have an error that i can´t fix "newTxt is not defined"
can somebody help me?

greetings!


RG Ramesh Govindaraj Syncfusion Team February 24, 2016 11:57 AM UTC

Hi Ruzic,

We are unable to reproduce the reported problem in the sample provided in the last update. So, could you please provide the complete replication steps to reproduce this problem? We also suggest that you upgrade your product to the latest version (v13.4.0.58) and test the same.

Regards,
Ramesh G.



RI RI March 7, 2016 10:29 AM UTC

Hi Ramesh,

the update won´t fix my problem, well since the Pivot doesn´t have a save function i wrote my own.
Now i want to load the data back to the view and i get following error in the console:

ReferenceError: newTxt is not defined
    at Object.ej.PivotAnalysis._insertTotalHeader (http://localhost:52987/Scripts/Syncfusion/ej.web.all.js:281615:95)
    at Object.ej.PivotAnalysis.pivotEnginePopulate (http://localhost:52987/Scripts/Syncfusion/ej.web.all.js:281396:22)
    at Object.t.widget._populatePivotGrid (http://localhost:52987/Scripts/Syncfusion/ej.widgets.all.min.js:10:6156834)
    at Object.t.widget._load (http://localhost:52987/Scripts/Syncfusion/ej.widgets.all.min.js:10:6156332)
    at Object.t.widget._init (http://localhost:52987/Scripts/Syncfusion/ej.widgets.all.min.js:10:6152399)
    at Object.<anonymous> (http://localhost:52987/Scripts/Syncfusion/ej.widgets.all.min.js:10:18367)
    at $.fn.(anonymous function) [as ejPivotGrid] (http://localhost:52987/Scripts/Syncfusion/ej.web.all.js:1158:25)
    at Scope.$scope.loadPivot (http://localhost:52987/Scripts/app/controllers/NewReportCtrl.js:1809:26)
    at http://localhost:52987/Scripts/app/factories/Report.js:125:27
    at processQueue (http://localhost:52987/Scripts/angular.js:13248:27)

Here is my code:

    $scope.loadPivot = function () {
        $("#PivotGrids").remove();
        var pivotGrid = ej.buildTag("div#PivotGrids", "", { height: 600, width: "60%", "float": "left", "overflow": "auto", "margin-top": "20px" })[0].outerHTML;
        $(pivotGrid).appendTo(".controls");

        $("#PivotSchemaDesigner").remove();
        var schemaDesigner = ej.buildTag("div#PivotSchemaDesigner", "")[0].outerHTML;
        $(schemaDesigner).appendTo(".PivotSchema");
        console.log($scope.PivotData);
        $scope.pivotRows = [],
        $scope.pivotColumns = [], 
        $scope.pivotValues = [],
        $scope.pivotSlicers = [],

        angular.forEach($scope.PivotData, function (value) {
            if (value.axis == "Rows") {
                $scope.pivotRows.push({
                    fieldName: value.name,
                    fieldCaption: value.name
                });
            }
            if (value.axis == "Columns") {
                $scope.pivotColumns.push({
                    fieldName: value.name,
                    fieldCaption: value.name
                });
            }
            if (value.axis == "values") {
                $scope.pivotValues.push({
                    fieldName: value.name,
                    fieldCaption: value.name
                });
            }
            if (value.axis == "Slicers") {
                $scope.pivotSlicers.push({
                    fieldName: value.name,
                    fieldCaption: value.name
                });
            }
        });


        $("#PivotGrids").ejPivotGrid({
            dataSource: {
                data: $scope.PivotData,
                rows: $scope.pivotRows,
                columns: $scope.pivotColumns,
                values: $scope.pivotValues
            }
        });
    }




RG Ramesh Govindaraj Syncfusion Team March 8, 2016 07:32 AM UTC

Hi Ruzic,

We are glad to announce that our Essential Studio service pack 2 for Volume 4, 2015 is rolled out and is available for download under the following link:

http://www.syncfusion.com/forums/123314/essential-studio-2015-volume-4-service-pack-release-v13-4-0-63-available-for-download

In this build, you can render empty PivotGrid initially and bind data source later (reported in your incident ID: 150595). So, we kindly suggest you to upgrade the product and frame logic accordingly. If still the problem exists, please provide us a sample so that we can check and provide you a solution at the earliest.

Regards,
Ramesh G.


Loader.
Live Chat Icon For mobile
Up arrow icon