ioBroker / dev-docs

Developer documentation
5 stars 4 forks source link

[jsonConfig] several topics / FAQ #28

Open mcm1957 opened 2 years ago

mcm1957 commented 2 years ago

I would like to note some topics related to jsonConfig creation. I could add this directly into the docu - but I could not yet detect the best place for it. So I will note those remarks here -feel free to contact me if a template exists where I could/should edit this directly.

  1. Usage of true/false at "hidden" or "validator" Using true or false as text for "hidden", "validator", ... does not work. You will get en error in console window. You can use "0" or "1" when testing the attrubites with a fixed value (i.e. to check whether your rule is false or how the message will look.)

  2. You can use "data.fieldname" in expressions for "hidden", ... Make sure that the object exists or use data.fieldname&&data.fieldname!=''

  3. You can access every field even if it is located at another tab, You can access elements of a table using array syntax (data.tablename[ii].filedname == ...)

  4. When validating elements of a table or hide entries inside a table depending on another field of the same wor use data.fieldname to address exactly the fiels of the current row. The tablename must be omitted. Example: if field password should be hidden in a table when field authcode is 2 then use "hidden: "data.authcode==2" at the definition of field password.

... I will add futher notes when I encounter things which I did not expect at the first glance ...

McM1957

klein0r commented 2 years ago

See #23