proto ui.layout and events

hi,

please, help me with proto.ui:

https://snippet.webix.com/rzrmpb1x

  1. how to attach event to combo? i’ve tried $ready as described here:
    Creating a Custom Component of Guides, Extending Сomponents Webix Docs
    but it doesn’t work

  2. How to inherit form’s elementsConfig in proto?

Hi, @keson

  1. combo does not have onAfterSelect event. use onChange instead
  2. combo does not have getItem method. use getList().getItem instead
  3. suggest’s template should return string value to work properly
    sheck this

@integral

yes, i used ‘onAfterSelect’ to adress suggest, but forgot to add getList() as You wrote Code Snippet

thank You !

Any ideas on second question?

Any ideas on second question?
try this

    var parentForm = this.getFormView();
    var elementsConfig = parentForm.config.elementsConfig;
    console.log(elementsConfig);

unfortunately parent’s elementsConfig not applied in your scenario and you need to extend child configs manually.
https://snippet.webix.com/z84qun08
line: 47

@integral
Yep, but i don’t know if its possible to apply this config directly to layout.ui.

I think, this should do the trick:
https://snippet.webix.com/e23ac28a

@integral,
thank You for second part of the answer.
One more thing: how to handle initial values, fi. form parse (line 68)?

https://snippet.webix.com/nxaj6g34

@keson
you forgot to define id for the form
https://snippet.webix.com/mk98l0x0
if you need to set initial text value then you need a bit deeper implementation, like initial or postponed access to data source.

@integral, i think $ready doesn’t mean that controls are accessible, adding small timeout is a little step forward:

https://snippet.webix.com/m8sh6leo

Hi @keson

As far as I can see, the last example in the conversation is almost correct, but the main issue here is the availability of data ( the list.getItem(id) returns undefined ).
The order of initialization makes nested widgets accessible within the $ready handlers (example: Code Snippet), but the component’s initialization and data loading are separate processes.
The data loading is always an async process, and although the client-side data is parsed pretty quickly (delay is usually not required after full webix.ui execution), a reference to the data of Datatable (in gridsuggest) may point to the empty storage until the full process is finalized.

To ensure that the data is obtained (either for client-side or remote data loading), you can use the waitData promise instead of custom timeout: Code Snippet
I have also commented two extra properties in the protoUI config (as they do not have an actual impact).