Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

brunodgarcia
New Contributor II

Widget - API Not Working

Hi,

I'm trying to use the name of a dimension as a parameter for a clear button, but it only works if I set the name of the field using a static value:

<div class="lui-buttongroup">
<lui-button ng-click="app.field('FIELD_NAME').clear()"                                           >Clear WORKS OK!         </lui-button>
<lui-button ng-click="app.field('{{data.headers[0].qFallbackTitle}}').clear()">Clear DOESN'T WORK</lui-button>
</div>

If you include the ng-click parameter as text in the widged, you'll notice that the expression is parsed correctly.

Any guess why it doesn't work?

1 Solution

Accepted Solutions
Highlighted
Employee
Employee

Re: Widget - API Not Working

Hi,

 

In angularjs, for data binding, you don't need the double curly brace, this is used mostly for string expressions (https://docs.angularjs.org/guide/templates).

try:

<lui-button ng-click="app.field(data.headers[0].qFallbackTitle).clear()">Clear DOESN'T WORK</lui-button>
<!-- instead of -->
<lui-button ng-click="app.field('{{data.headers[0].qFallbackTitle}}').clear()">Clear DOESN'T WORK</lui-button>

 

I hope this helps,

1 Reply
Highlighted
Employee
Employee

Re: Widget - API Not Working

Hi,

 

In angularjs, for data binding, you don't need the double curly brace, this is used mostly for string expressions (https://docs.angularjs.org/guide/templates).

try:

<lui-button ng-click="app.field(data.headers[0].qFallbackTitle).clear()">Clear DOESN'T WORK</lui-button>
<!-- instead of -->
<lui-button ng-click="app.field('{{data.headers[0].qFallbackTitle}}').clear()">Clear DOESN'T WORK</lui-button>

 

I hope this helps,