Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
IVAN-FELIPE
Employee
Employee

How to change a extension setting

Dear colleagues

Is it possible to modify the extension settings without using the extension object properties panel?, and then persist the new values (do not disappearing when clicking on F5)?

I just need a basic example about how to:

- show a button on the front end (not extension properties panel)

- click on a button and then modify one extension setting (just will make sense if you are on Edit mode)

 

This seems easy but I can't find any example. 

I tryed a basic

layout.myProperty = true; in my js code

This just modify the properties temporarily but the new value does not persist.

 

Thanks for your help!

2 Solutions

Accepted Solutions
IVAN-FELIPE
Employee
Employee
Author

Hi

Nice plugin, very useful, it worked for me, the right path/code was:

this.backendApi.applyPatches([
{
"qPath": "/buttons/dimfields",
"qOp": "replace",
"qValue": "2"
}
], false);

It changes the value of the setting, but unfortunately it loops, and repeats the process continuously.

Any experiences with this issue?

Regards

View solution in original post

ErikWetterberg

Are you doing this in the paint method? Perhaps you should check that the property does not already have the correct value? Or perhaps you should do it when the user clicks on a button, meny etc.

View solution in original post

6 Replies
IVAN-FELIPE
Employee
Employee
Author

Hi Erik

 

Thanks, I believe I'm in the right path. But there are no good examples.

 

Could you help, I'm trying to modify the property 'dimfields' of an extension:

layout.backendApi.applyPatches([
{
"qPath": "/dimfields",
"qOp": "replace",
"qValue": "2"
}
], false);

 

When I type the this code, nothing happens.

Is it just a question about the qPath ? if the answer is yes, how can I find the right path ?

 

Thanks again!

ErikWetterberg

Hi,

You can check the properties in the developer meny. Or you could use the Chrome extension I have developed:

https://chrome.google.com/webstore/detail/add-sense/bbiljflfafkaejgdebbnmcohpidgkejj

IVAN-FELIPE
Employee
Employee
Author

Hi

Nice plugin, very useful, it worked for me, the right path/code was:

this.backendApi.applyPatches([
{
"qPath": "/buttons/dimfields",
"qOp": "replace",
"qValue": "2"
}
], false);

It changes the value of the setting, but unfortunately it loops, and repeats the process continuously.

Any experiences with this issue?

Regards

ErikWetterberg

Are you doing this in the paint method? Perhaps you should check that the property does not already have the correct value? Or perhaps you should do it when the user clicks on a button, meny etc.

IVAN-FELIPE
Employee
Employee
Author

My blame, after applying the patches in the right event it works.

In the paint method, using an event when clicking a button.

 

Thanks a lot Erik!!