Question

Change Value of Field Without Firing Changed Events

Hello!

 

Is there a way to set a field value in a schema file, without firing the associated changed triggers/events? I want to change a field value when a user loads a card schema, but I do not want the Save button to appear. If they make any other changes though, I do want the save button to appear as normal.

 

Thank you!

Chris

Like 0

Like

4 comments
Best reply

Hello Chris, 

 

Thank you for your question! 

 

Please, try to use the parameter (argument) "Silent":  this.set("Status", status.values, {silent: true}); 

It will not fire any triggers/events and will not change a displayed value in UI. 

Another way is to update a card button visibility: this.updateButtonsVisibility(false, {force: true}); in case it is enough to hide a button.

 

Best regards, 

Olga. 

Hello Chris, 

 

Thank you for your question! 

 

Please, try to use the parameter (argument) "Silent":  this.set("Status", status.values, {silent: true}); 

It will not fire any triggers/events and will not change a displayed value in UI. 

Another way is to update a card button visibility: this.updateButtonsVisibility(false, {force: true}); in case it is enough to hide a button.

 

Best regards, 

Olga. 

Hey Olga,

 

I already tried the silent: true option, but as you mentioned it does not update the value that is displayed (which I need). I guess I can go the route of updating the button visibility, but is there any other options that can be passed when setting the field value, or other functions that can be called that would prevent the triggering of the changed events when setting the field value?

 

Thank you!

Chris

Hello Chris,

 

Unfortunately, we can propose only these 2 options - "silent" mode and "invisible" button.

Hey Anton,

 

The "silent" mode option doesn't work, but it looks like the updateButtonsVisibility function will work for this situation.

 

Thank you!

Chris

Show all comments