Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Not applicable

Qlik Sense Mashup qheight dynamically

Hello,

I am developing a mashup project.

I want to set value to qheight in CreateList method dynamically. But I don't know how to set value qheight. Do you have information about this topic ?

app.createList({

  "qFrequencyMode": "V",

  "qDef": {

  "qFieldDefs": [

  "Personel Sicil Ad Soyad"

  ]

  },

  "qExpressions": [],

  "qInitialDataFetch": [

  {

  "qHeight":1,

  "qWidth": 10000 //  it must be dynamically

  }

  ],

  "qLibraryId": null

  },SearchCV);

1 Solution

Accepted Solutions
websy1985
New Contributor III

Re: Qlik Sense Mashup qheight dynamically

It's probably best not to use the pageHeight variable for looping through the response data. This is because you may have requested 500 rows for example, but only received 200. Also, the page object returned in the promise is also an array so, assuming you've only requested a single page, I would do this instead -

for (var i = 0; i <page[0].qMatrix.length; i++) {

  data.push(page[0].qMatrix.length[0].qText);

}

This also assumes that you have an array variable called data that is available in the current scope.

6 Replies
Employee
Employee

Re: Qlik Sense Mashup qheight dynamically

try 0

Not applicable

Re: Qlik Sense Mashup qheight dynamically

I tried it but i didn't get data

websy1985
New Contributor III

Re: Qlik Sense Mashup qheight dynamically

You could omit the qInitialDataFetch property and use the getListObjectData function to fetch the data after the object has been instantiated, like this -

app.createList({
       "qFrequencyMode": "V",
       "qDef": {
          "qFieldDefs": [
            "Personel Sicil Ad Soyad"
          ]
       },
       "qExpressions": [],
       "qLibraryId": null
       }).then(function(response){
          var pageWidth = response.layout.qListObject.qSize.qcx;
          var pageHeight = Math.floor(10000, pageWidth);
          return response.enigmaModel.getListObjectData("/qListObjectDef", [{qTop: 0, qLeft:0, qHeight: pageHeight, qWidth: pageWidth}])
     }).then(function(page){
       //page should have data according to the above page request       
     });
Not applicable

Re: Qlik Sense Mashup qheight dynamically

Hello Nick

How to write code below function. Is it true below ?

....

}).then(function(page){

//page should have data according to the above page request

for (var i = 0; i < pageHeight; i++) {

  data.push(page.qMatrix[0].qText);

  }

});

websy1985
New Contributor III

Re: Qlik Sense Mashup qheight dynamically

It's probably best not to use the pageHeight variable for looping through the response data. This is because you may have requested 500 rows for example, but only received 200. Also, the page object returned in the promise is also an array so, assuming you've only requested a single page, I would do this instead -

for (var i = 0; i <page[0].qMatrix.length; i++) {

  data.push(page[0].qMatrix.length[0].qText);

}

This also assumes that you have an array variable called data that is available in the current scope.

Not applicable

Re: Qlik Sense Mashup qheight dynamically

Thanks a lot

Community Browser