richselect 'load' method

Hi,

I have form like this:

{ view: ‘form’, scroll: true,
elements: [
{ view: ‘text’, label: ‘Mnz’, labelPosition: ‘left’, labelAlign: ‘left’, type: ‘text’, id: ‘qty_text’},
{ view: ‘richselect’, label: ‘Label’, id: ‘control_richselect_2’, scroll: ‘true’}
], id: ‘ordr_form’
},’

What I need to do, is to load data into my richselect “control_richselect_2”. So in forum I found a topic “richselect suggestion” where Stanislav wrote:

"Both combo and richselect support data loading functionality by default, you can use
If you have richselect with id=“myselect”, you can use

$$(‘myselect_list’).load(“data.url”);"

So I was trying it:

$$(“control_richselect_2”).load(‘http://fek.jandb.sk/service.php?method=get_products’,'xml’);

But error occured:
Uncaught TypeError: Object # has no method ‘load’

I`m missing something??

I`m using this touchui.js → in attachment…
touchui.zip (55.4 KB)

I think you need to reference the inner list used by the richselect control, like this :-

$$("control_richselect_2_list").load('http://fek.jandb.sk/service.php?method=get_products','xml');

i.e. just add “_list” on the end of the control’s ID.

Hi,

there are two possible ways:

  1. { view: ‘richselect’, label: ‘Label’, id: ‘control_richselect_2’, scroll: ‘true’,url:“data.url”,datatype:“xml”}

  2. var list = $$( ‘control_richselect_2’).getList();
    list.load(“data.url”,“xml”);

thanks to you both for suggestions …
First I tried an Mark`s idea . And really works …

When the element id is called “control_richselect_2”, so to load method is needed to write: $$(“control_richselect_2_list”).load…

interesting :slight_smile: