Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
since v1.1 we do not get a property created in paint function layout object for the custom property if its value is left to default value. Only if we change the property value in accordeon the property gets created in layout object. Is this an issue or feature? If it's a feature, how we can access the default value then?
I have to add that I'm using a show condition for the property but doesn't matter if it's true or false..
- Ralf
Hi rbecher
thx for reporting this behavior, but unfortunately I do not fully get it ...
Can you ellaborate a bit more or post some code sample explaining what you want to see and what's happening, then I'll have a look into it.
Regards
Stefan
Hi Stefan,
cannot reproduce it. Must be a glitch (caching issue?) while extending custom properties in existing and used extension. However I attached a sample which shows how you can use "show" property to switch optional properties on another boolean property (would have been nice to find an example in the online help..).
Best regards,
Ralf
Hi Ralf,
agree that there should be a demo in the online help to show how it works.
But your example works perfect for me and code looks straighforward (as expected to be).
Regards
Stefan
Hi Stefan,
is it possible to nest properties in accordeon with the switch component like with the chart color settings?
- Ralf
Sorry, don't get it again 😉
Do you mean this setting or something else, because this is working exactly the same way as your previously posted example:
Best regards
Stefan
I would like to have it like in common settings where we have a switch and nested properties:
In my example I have a tab/dropdown per property:
OK, will work on an example and publish it ...
Hi Ralph,
Thanks for sharing.
To ensure to get a value, you may set an initial default value in the initialProperties object, to be the default value when user first time drop the extension on the sheet :
initialProperties: {
version: 1,
optionalProp: false,
qHyperCubeDef: {
I would also check for undefined properties, like this :
return (layout.optionalProp === undefined ? false : layout.optionalProp)
This will ensure to get a default value, i.e. if the user open an old app with a previous release of the extension that didn't had yet this property defined. But this may also solve your missing default value.
Regards
Hi,
To get this behaviour, you need to group by items lists :
definition: { type: "items", component: "accordion", items: { settings: { uses: "settings", type : "items", items : { firstGroup : { label : "Group 1", type : "items", items:{ testProp1: { ref: "testProp1", type: "string", label: "Property 1", defaultValue: "default1" } } }, secondGroup : { label : "Group 2", type : "items", items:{ optionalProp: { ref: "optionalProp", type: "boolean", label: "Optional Property", defaultValue: false }, testProp2: { ref: "testProp2", type: "string", label: "Property 2", defaultValue: "default2", show: function(layout) { return layout.optionalProp } }, testProp3: { ref: "testProp3", type: "string", label: "Property 3", defaultValue: "default3", show: function(layout) { return layout.optionalProp } } } } } } } },
Sorry I lost indentations, but it works :
Regards