View properties as object collection/structure?

Hello,

Is there a way to specify view properties as an object collection/structure?

For example:
var defaultTextProperties = { labelWidth: 60, labelAlign: "right" }

{ view: "text", id: "name", label: "Name", additionalProperties: defaultTextProperties }

I know that elementsConfig can be used in a form to apply to all elements, but I am looking for a way to generally specify certain properties as a structure.

Thank you in advance!

Comments

  • edited October 9

    Hello @bhogg2007 ,
    As a solution, you can define the default values for some configuration settings in the defaults of a component. Defaults can be overwritten when you create an instance or use define.
    Please take a look at the following example:
    https://snippet.webix.com/vgix1wao

    Please note that defaults property should only be used for static settings, while it is better to work with data either after initialization.

    The feature is described in the related docs chapter

  • Thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!