qlik-demo-team / qdt-components

React Components to be used with Angular 10, React 16 and Vue 2. Connects with the Capability API and Engine API.
MIT License
92 stars 50 forks source link

Can't create react vizualization component with pre-selected fields filter #40

Closed gchehab closed 6 years ago

gchehab commented 6 years ago

I am using qdt-components react on my applications and wanted to create visualizations with pre-selected filters. I have seen an plain .js implementation that used something like:

app = qlik.openApp('12334ac4-61e0-4476-b227-1540f2004022', config); // Object Filter app.field('ORG_SUPER_PADR_ID').selectMatch('2607', true); app.getObject('obj-name', '1ab7f73e-48c7-4688-9e6d-d8027c9b4f42', { noSelections : true, noIteraction : false});

What would be the react api equivalent of the app.field call, and how is it used?

yianni-ververis commented 6 years ago

Most of our examples are in React. https://webapps.qlik.com/qdt-components/react/index.html

Regarding the app.field, in the QdtComponents class do,

const qDoc = await qdtComponents.qDocPromise; const qField = await qDoc.getField('ORG_SUPER_PADR_ID'); qField.selectMatch('2607', true); OR qField.selectValues([{ qText: 'Heating Temp' }], true, true); OR qField.select([1,5], true, true);

gchehab commented 6 years ago

It did the trick, thanks a lot!