Qlik Community

QlikView Extensions

Discussion Board for collaboration on QlikView Extensions.

danielrozental
Honored Contributor II

Triggering actions from Extensions

Hi, does anyone know if it's possible to trigger actions from within Extensions? How about doing a dynamic update from Javascript, is that possible?

Tags (3)
1 Solution

Accepted Solutions
Employee
Employee

Re: Triggering actions from Extensions

Well I'm fairly certain updating the model from the JS API is not possible, but I'm pretty sure you can similate a button click from inside an extension.  How javascript savvy are you?

What you could do is target the ID or class of the button (if possible...i'm not sure actually if the object IDs are yet available in the html code), and use the following jquery code to similate a click:

$("#your_item").trigger("click");

Another way I've triggered events from extensions (this might not work for what you need) is by changing variables from inside the extension and having triggers on these variables which run actions when the variable is updated.

THis might be a bit roundabout for what you're trying to do, but....that's what I've done before for other purposes.

11 Replies
Employee
Employee

Re: Triggering actions from Extensions

What kind of actions are you looking to trigger?    

danielrozental
Honored Contributor II

Re: Triggering actions from Extensions

I'm looking to trigger a dynamic update through a button.

Employee
Employee

Re: Triggering actions from Extensions

I assume the QVW/QVS would be setup to support dynamic update on that app?  If that's set up properly (and keep in mind this feature is very tricky and delicate), the app will update as soon as the data is changed.  Do you want the button to somehow update the data set?    

danielrozental
Honored Contributor II

Re: Triggering actions from Extensions

I know I can use buttons to update the model, what I'm looking for is a way to enter information in an extension and then somehow, be able to insert that information into the model.

Employee
Employee

Re: Triggering actions from Extensions

The only experience I've had with this was where I set up an extension to insert data into the SQL database that held the app's data.  This database would then run a job that used the QlikView OCX to insert that data back into the app, which would update itself since it was running dynamic update.

Kind of a weird roundabout way to do itm and obviously not ideal.    

Highlighted
danielrozental
Honored Contributor II

Re: Triggering actions from Extensions

Thanks a lot for your input Brian, I just thought there might be a way to do it directly through the JS API or at least be able to trigger a button click from within the extension.

Employee
Employee

Re: Triggering actions from Extensions

Well I'm fairly certain updating the model from the JS API is not possible, but I'm pretty sure you can similate a button click from inside an extension.  How javascript savvy are you?

What you could do is target the ID or class of the button (if possible...i'm not sure actually if the object IDs are yet available in the html code), and use the following jquery code to similate a click:

$("#your_item").trigger("click");

Another way I've triggered events from extensions (this might not work for what you need) is by changing variables from inside the extension and having triggers on these variables which run actions when the variable is updated.

THis might be a bit roundabout for what you're trying to do, but....that's what I've done before for other purposes.

danielrozental
Honored Contributor II

Re: Triggering actions from Extensions

Great, that seems close to what I'm looking for. Thanks again.

danielrozental
Honored Contributor II

Re: Triggering actions from Extensions

Brian, any chance you could share your code about changing variables from within the extension?