View Categories

View script function – ListBox, TextBox, ComboBox (Smart input)

Select an Item/Index #

For ComboBox and ListBox will select a given item. For TextBox will set value of TextBox to new value.

myscada.setSelectedItem('id','item');

For ComboBox and ListBox will set item to given index.

myscada.setSelectedIndex('id',3);

Get Selected Item/Index #

Will return selected value or undefined if nothing is selected.

myscada.getSelectedItem('id');

Will return selected index eg. hierarchical number of selected element. If nothing is selected, -1 will be returned.

myscada.getSelectedIndex('id');

Set New Items #

Will set new items to ListBox or ComboBox. Pass id of element and then array of items.

myscada.setItems('id',['item1','item2','item3']);

Will set value to TextBox.

myscada.setItems('id','item1');