How to update text field suggest

I’m trying to link two text fields. When you select a product the suggestions for revision change.

I can’t handle the event when the value changes in the product text field.

When you select ‘One’ for the product the available options for revision would be 1.
If you select ‘Two’ for the product the available options for revision would be 1 and 2.

http://webix.com/snippet/cf05c2de

http://docs.webix.com/api__link__ui.text_onchange_event.html

{view:"text",on:{
   onChange:function(newValue, oldValue){
      ...
   }
}
}

Thanks that works.

How would you dynamically change the suggest?

http://webix.com/snippet/e035f947

Okay I figured it out by using the answer from http://forum.webix.com/discussion/3868/how-to-dynamically-update-suggest-list-data

Here is it working
http://webix.com/snippet/46f47d61

What is the recommended way to re-use components?

Could you please clarify, which components do you want to re-use?
The common way to populate an object is to use webix.copy().

I’m trying to make the product selector generic. So I can have multiple on the page with different data. And have other components linked.

How do you store data for a component.

Ideally the usage would be

{“view”: “custom”, dataProducts: myProducts}

http://docs.webix.com/desktop__custom_component.html

In the above docs I don’t see how you reference yourself (to get the data).

In my snippet I was using $$(“productTextField”).data.dataProducts;

But for a custom component you don’t set the id.

How do you store data for a component.

$init is a function where you can change any configuration properties:

http://webix.com/snippet/9672748e

$$("productTextField").data is a reference to the DataStore.