Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
ikomlyakov1929
Partner - Contributor III
Partner - Contributor III

Field API error this.genericObject.close is not a function

I'm trying to get unique values for current field in extension. That's what I do:

$scope.backendApi.getDimensionInfos().forEach( function( value, col ) {

     var data = qlik.currApp().field(value.qGroupFieldDefs[0].toString()).getData();

     var listener = function () {

            $.each(this.rows, function(idx, row) {

                  // do smth

            })

            data.OnData.unbind(listener);

     };

     data.OnData.bind(listener);

  });

I have this extension on several sheets. When i first time open app this works well, but when i go to another page, this extension give me the following error:

TypeError: this.genericObject.close is not a function

    at e.getData (client.js??1497008912700:66)

    at filterTree.js??1497008912700:65  <-------that is my extension

    at Array.forEach (<anonymous>)

    at buildTree (filterTree.js??1497008912700:62)

    at Object.<anonymous> (filterTree.js??1497008912700:35)

    at client.js??1497008912700:3

    at Array.forEach (<anonymous>)

    at a.emit (client.js??1497008912700:3)

    at Object.setState (client.js??1497008912700:18)

    at client.js??1497008912700:18

1 Solution

Accepted Solutions
ikomlyakov1929
Partner - Contributor III
Partner - Contributor III
Author

I have checked the Table API and found the way to solve my problem. The answer is to create different table(hypercube) for each dimension in extension. Here is code

$scope.backendApi.getDimensionInfos().forEach( function( value, col ) {

var dim = [value.qGroupFieldDefs[0].toString()];

var fltr = qlik.currApp().createTable(dim, [], {rows:200});

var listener = function () {

$.each(fltr.qHyperCube.qDataPages[0].qMatrix, function(idx, row) {

//do smth

})

}

fltr.OnData.bind(listener)

  });

Thank you Rikard‌‌!

View solution in original post

4 Replies
rav
Employee
Employee

Hi Ilya!

The problem you describe is a known issue to us and we are looking into it.

Looking at what you are trying to achieve, it feels like that you might be able to use the Table API instead to solve your problem. With the table API you will be able to get information from all the fields that are tied to your extension. The information you get back is also automatically updated when you make selections in your app. Look at the QTable specifically. QTable ‒ Qlik Sense

Hopefully you can find a workaround using qTable instead.

Regards Rikard

ikomlyakov1929
Partner - Contributor III
Partner - Contributor III
Author

Hi Rikard!

     Thank you for your response. My extension is filter panel with about a 20 dimensions to filter. Some of them are variables. So I would like to get unique values for each dimension with qElemNumber for filtering. As I understand, trying to get all data for each dimension and then get unique - is not an option, because of an amount of data.

I'll try to use Table API. I will write back about results.

ikomlyakov1929
Partner - Contributor III
Partner - Contributor III
Author

I have checked the Table API and found the way to solve my problem. The answer is to create different table(hypercube) for each dimension in extension. Here is code

$scope.backendApi.getDimensionInfos().forEach( function( value, col ) {

var dim = [value.qGroupFieldDefs[0].toString()];

var fltr = qlik.currApp().createTable(dim, [], {rows:200});

var listener = function () {

$.each(fltr.qHyperCube.qDataPages[0].qMatrix, function(idx, row) {

//do smth

})

}

fltr.OnData.bind(listener)

  });

Thank you Rikard‌‌!

rav
Employee
Employee

It's unfortinate that you had to do this workaround but I'm happy you found a solution. Thanks for posting your solution as it might help others with the same problem.