Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
danielrozental
Master II
Master 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?

1 Solution

Accepted Solutions
Brian_Munz
Employee
Employee

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.

View solution in original post

11 Replies
Brian_Munz
Employee
Employee

What kind of actions are you looking to trigger?    

danielrozental
Master II
Master II
Author

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

Brian_Munz
Employee
Employee

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
Master II
Master II
Author

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.

Brian_Munz
Employee
Employee

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.    

danielrozental
Master II
Master II
Author

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.

Brian_Munz
Employee
Employee

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
Master II
Master II
Author

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

danielrozental
Master II
Master II
Author

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