Getting form Values from a form nested deep inside a webix window object

I have a complex layout with a form nested deeply in it. I’m trying to call the getValues() method on the form but cannot seem to get a reference to the form object. I have a snippet with the code here: http://webix.com/snippet/a936d18a

I need to get the data from the form when the user presses the “Search” button/

Any help would be greatly appreciated as I cannot seem to get data from the form.

Instead of
searchForm.getValues();
you need to use
$$(“searchForm”).getValues();

or in case of webix 1.6, you can use this.getFormView() to get form related to the clicked button

http://webix.com/snippet/a2d16619

Maksin,

Thank you for your reply. This has partially solved my problem.

The getValues() now works if I use the reference $$(“searchForm”).

However, when I attempt to reference any of the other widgets in my UI, something like:

$$(“searchresults”).clearAll();

I get an error similar to the following error:

Uncaught TypeError: Object [object Array] has no method ‘clearAll’

This call DOES work in the attached snippet, but it does not work in my application.
(Note: my application is integrated into a larger application, so I realize there may be other things that are interfering with it ).

http://webix.com/snippet/3ff0a632

I’m wondering if there is a way to create an explicit reference to part if the UI so I can call the methods on the objects?

Is there a better way to construct this UI? Should I break it into smaller pieces?

FYI: I upgraded to 1.6 today, so this is all 1.6

  • if there is a way to create an explicit reference to part if the UI

The $$ operation do this, it returns the reference to the object by object’s ID. Also, you can use result of webix.ui, it returns the top object of created UI

It possible that you are using some other lib on the page, and this lib redefines $$ operator ( jQuery UI for example ), in such case you need to use webix.$$ instead of $$ ( it is the same command, but you can be sure that webix.$$ is not redefined by any third party library )

Thank you, that worked perfectly. Obviously there is some other lib redefining $$, so webix.$$ works great for me.