0 Replies Latest reply: May 25, 2017 4:54 AM by Twee Wan Wong RSS

    TypeError: Cannot read property 'qMatrix' of undefined

    Twee Wan Wong

      I am a new user on Qlik Sense Desktop version. To familiarize with the mashup, i create a mashup using

      HelpDesk Management App as base. I create  a List and added the list into the mashup.

      I have confirmed the app.createList function is there and i have edited the empty callback function to :

       

       

      //callbacks -- inserted here --

        function cbYear(reply, app){

            $("#divYear").empty();

          var qobject = reply.qListObject;

          console.log(qobject);  // <<===== I log this in console.

         

          $.each(qobject.qDataPages[0].qMatrix, function() {

              var item = this[0];

          var selT= "";

          console.log(item.qState);

         

          if (item.qState=="S") {

            selT=" style=\"backgroundcolor:black\"";

          }

              $("#divYear").append("<button type=checkbox " + selT + " class=\"btn btn-primary pull-right\">" + item.qText + "</button>")

            }) ;

        

        $("#divYear button").click( function() {

           app.field('Year').selectMatch($(this).text(),false);

        });

      }

       

      Strange thing is that the reply parameter returns no values of dimension "Year".

       

      1. Object {qSize: Object, qDimensionInfo: Object, qExpressions: Array(0), qDataPages: Array(0)}
        1. qDataPages:Array(0)
          1. length:0 <==== nothing gets return
          2. __proto__:Array(0)
        2. qDimensionInfo:Object
          1. qApprMaxGlyphCount:0
          2. qAttrDimInfo:Array(0)
          3. qAttrExprInfo:Array(0)

       

       

      And there is error in the browser console :

      TypeError: Cannot read property 'qMatrix' of undefined  <====== ERROR

          at cbYear (HelpDeskMashup.js:111)

          at a (qlik.js:84)

          at qlik.js:84

          at g (require.js:45)

          at require.js:45

       

       

      I search through google , but don't find anything useful on this.

      Anyone can help here ?