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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Cannot read property 'keys' of null

Thread ID:





125659 Aug 31,2016 02:48 PM UTC Sep 2,2016 08:45 AM UTC JavaScript 6
Tags: ejPivotGrid
Asked On August 31, 2016 02:48 PM UTC


i have following problem, i try to load data from DB, and build the pivot. But i get the following error:

angular.js:11655 TypeError: Cannot read property 'keys' of null
    at http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:329132:62
    at Function.grep (http://localhost:52987/Scripts/jquery.js:447:23)
    at Object._populateCalcTable (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:329130:27)
    at Object._calculateValues (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:328986:22)
    at Object.pivotEnginePopulate (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:328547:18)
    at Object._populatePivotGrid (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:329980:42)
    at Object._load (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:329906:26)
    at Object._init (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:329786:18)
    at Object.<anonymous> (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:1183:18)
    at jQuery.$.fn.(anonymous function) [as ejPivotGrid] (http://localhost:52987/Scripts/syncfusion/scripts/web/ej.web.all.js:1243:25)(anonymous function) @ angular.js:11655(anonymous function) @ angular.js:8596(anonymous function) @ angular.js:16302completeOutstandingRequest @ angular.js:4924(anonymous function) @ angular.js:5312

Sastha Prathap Selvamoorthy [Syncfusion]
Replied On September 1, 2016 06:26 AM UTC

Hi Ruzic, 
Sorry for the inconvenience. Due to lack of information, we are unable to provide solution for the reported problem. So, please provided us the detailed information along with your sample and scenario where the reported problem got reflected. 
Sastha Prathap S. 

Replied On September 1, 2016 08:40 AM UTC

Hello Sastha,

i have a function to build pivot with data from database:

$scope.loadPivot = function () {
        var pivotGrid = ej.buildTag("div#PivotGrid", "", {
            width: "100%",
            "overflow": "auto",
            "float": "left",
            "margin-top": "20px"


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

        $scope.pivotRows = [],
        $scope.pivotColumns = [],
        $scope.pivotValues = [],
        $scope.pivotSlicers = [],

        angular.forEach($scope.PivotData, function (value) {
            if (value.axis == "Rows") {
                    fieldName: value.fieldName,
                    fieldCaption: value.fieldName
            if (value.axis == "Columns") {
                    fieldName: value.fieldName,
                    fieldCaption: value.fieldName
            if (value.axis == "values") {
                    fieldName: value.fieldName,
                    fieldCaption: value.fieldName
            if (value.axis == "Slicers") {
                    fieldName: value.fieldName,
                    fieldCaption: value.fieldName

            dataSource: {
                data: $scope.PivotData,
                rows: $scope.pivotRows,
                columns: $scope.pivotColumns,
                values: $scope.pivotValues

in the Console, the data is valid. 
the error occurs here:

    $.grep(tableKeysCalcValues, function (item) {
                            if (item.uniqueName == rowKeysCalcValues[rCnt].uniqueName)
                                for (ky = 0 ; ky < item.value.keys.length; ky++)

grep: function( elems, callback, invert ) {
var callbackInverse,
matches = [],
i = 0,
length = elems.length,
callbackExpect = !invert;

// Go through the array, only saving the items
// that pass the validator function
for ( ; i < length; i++ ) {
callbackInverse = !callback( elems[ i ], i );
if ( callbackInverse !== callbackExpect ) {
matches.push( elems[ i ] );

return matches;

at this point, elems:

  1. Object
    1. keys:Array[1]
      1. 0:"(blank)"
      2. length:1
      3. __proto__:Array[0]
    2. uniqueName:"(blank)"
    3. value:null
Hope that helps

Replied On September 2, 2016 07:14 AM UTC


sorry, please close this thread, its my own stupidity :-), in my load function i call for the
dataSource, data: Scope.PivotData,

PivotData is a string, where my fieldCaption and Name is saved in NOT the data :-D!!

Sorry again and thanks for your help.


Replied On September 2, 2016 07:33 AM UTC

Me Again,

the error still occurs, nothing changed!!

please dont close the thread :-(

Replied On September 2, 2016 08:38 AM UTC

Works now!!!!

Sorry for the inconveniences

Sastha Prathap Selvamoorthy [Syncfusion]
Replied On September 2, 2016 08:45 AM UTC

Hi Ruzic, 
Thanks for your response. Please contact us for any further assistance. 
Sastha Prathap S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon