qlik-oss / sn-table

table supernova for nebula.js
https://qlik.dev/libraries-and-tools/visualizations/table
MIT License
6 stars 14 forks source link

Qlik Sense extension : e.useInteractionState is not a function #1115

Closed jeff-1984 closed 9 months ago

jeff-1984 commented 9 months ago

Hello,

I would like to try the supernova table in Qlik Sense.

I could get everything with npm i @nebula.js/sn-table

I zipped the folder node_modules\@nebula.js\sn-table\sn-table-ext and uploaded it in the QMC.

But the extension is generating an error :

TypeError: e.useInteractionState is not a function at component (sn-table.js:124:281336) at Object.aa [as run] (3023.682efc615bc89b586e2c.js:2:406439) at Object.render (3023.682efc615bc89b586e2c.js:2:417815) at DefaultView.paint (9265.1d3654cdd0060ac193f5.js:2:487633) at DefaultView.setInteractionState (9265.1d3654cdd0060ac193f5.js:2:488152) at Class.setInteractionState (9265.1d3654cdd0060ac193f5.js:2:456213) at Class.setInteractionState (7492.0f0abcd7c2a7516dc824.js:2:44403)

(the sn-table.js code is minified)

The QS Server is version August 2022 patch 16.

Did I anything wrong ?

Thanks, Jean-François

haxxmaxx commented 9 months ago

Hi!

OK so first off, the sn-table is included in the visualization bundle as of the May 2023 release of Sense. So one option is to update sense to that version, docs about it here.

I haven't seen anyone build it in this way before, but it might be possible. Installing the sn-table package is mainly meant for using the table outside of sense, like building your own mashup. The proper way of building it would be to clone this repo, install and build. As you know that can't be done atm, I will adress this in the other issue you commented.

So the error you are getting is due to Sense August 2022 uses an old version of nebula.js/stardust. It is the framework used to render these types of charts, and the old version doesn't have useInteractionState. You could go back to before sn-table started using that hook, that would be version 2.3.2. That being said, there could still be issues with that one. Then you can try 1.12.5. That would be the same table as you see when you select view data on a chart.

jeff-1984 commented 9 months ago

Hi,

Ok, thank you for your investigation !

Yes I think I will maybe use nebula.js if one day I create a mashup with a full custom front-end (outside of Qlik frontend).

The greatest benefit of nebula.js is to get rid of old frameworks like angularJS that comes with Qlik normal front-end right ?

Then for an extension, maybe it doesn't really make sense, as we are in the Qlik Sense front-end context anyway.

The nebula.js mentioned that we can build extension for QS then I wanted to try :-)

For new extensions, I start now from this project : https://github.com/softlore/qlik-es6-extension/tree/react-template

It's already a good thing to be able to use React...

Thanks, JF

haxxmaxx commented 9 months ago

The greatest benefit of nebula.js is to get rid of old frameworks like angularJS that comes with Qlik normal front-end right ?

Yes exactly, it is also a more lightweight solution than using the old Capability API