Is there a way to set noDeviceTarget value dynamically?

I have a widget where depending on the user’s choice I can either choose a device or leave the device field empty. Is there a way to switch “noDeviceTarget” dynamically? As now when you have “noDeviceTarget: false” it blocks the Save button until you choose a device.

Hi Alisa,

for your widget configuration can you define the property deviceTargetNotRequired and set it true. This will display the device selector but doesn’t require a device to be selected.

 data: {
	settings: {
	  noNewWidgets: false,
	  ng1: {
		options: {
		  noDeviceTarget: false,
		  groupsSelectable: false,
		  deviceTargetNotRequired: true
		}
	  }
	}
 } as ContextWidgetConfig

Theoretically, you can access the settings in the config input inside your widget configuration component. But changing the deviceTargetNotRequired property dynamically inside the config object doesn’t seem to have any effect. I will need to check on this.

Best regards
Christian

Hi Alisa

I just checked with R&D. At the moment, setting this property dynamically won’t have any effect. You will need to come up with something yourself. R&D is currently working on a new version of the asset/device selector, which will come with an ngModel allowing you to modify properties dynamically.

Best regards
Christian

Is there a list somewhere of all configurations we can have there?

Thank you! We’ll be waiting

Hi Alisa,

At the moment, there isn’t such a list. But this will change once the component is released.

Best regards
Christian

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.