{"id":65578,"date":"2026-11-25T19:16:00","date_gmt":"2026-11-25T18:16:00","guid":{"rendered":"https:\/\/amit-automation.cz\/podpora\/casto-kladene-otazky\/amit-designer-napoveda\/view-script-function-listbox-textbox-combobox-smart-input\/"},"modified":"2026-11-25T19:16:00","modified_gmt":"2026-11-25T18:16:00","slug":"view-script-function-listbox-textbox-combobox-smart-input","status":"publish","type":"napoveda","link":"https:\/\/amit-automation.cz\/en\/support\/faq\/amit-designer-help\/view-script-function-listbox-textbox-combobox-smart-input\/","title":{"rendered":"View script function \u2013 ListBox, TextBox, ComboBox (Smart input)"},"content":{"rendered":"<h3><span style=\"color: #4baddd;\">Select an Item\/Index<\/span><\/h3>\n<p style=\"text-align: justify;\">For ComboBox and ListBox will select a given item. For TextBox will set value of TextBox to new value.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setSelectedItem('id','item');<\/span><\/pre>\n<p style=\"text-align: justify;\">For ComboBox and ListBox will set item to given index.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setSelectedIndex('id',3);<\/span><\/pre>\n<h3><span style=\"color: #4baddd;\">Get Selected Item\/Index<\/span><\/h3>\n<p style=\"text-align: justify;\">Will return selected value or undefined if nothing is selected.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.getSelectedItem('id');<\/span><\/pre>\n<p style=\"text-align: justify;\">Will return selected index eg. hierarchical number of selected element. If nothing is selected, -1 will be returned.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.getSelectedIndex('id');<\/span><\/pre>\n<h3><span style=\"color: #4baddd;\">Set New Items<\/span><\/h3>\n<p style=\"text-align: justify;\">Will set new items to ListBox or ComboBox. Pass id of element and then array of items.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setItems('id',['item1','item2','item3']);<\/span><\/pre>\n<p style=\"text-align: justify;\">Will set value to TextBox.<\/p>\n<pre><span style=\"color: #4baddd;\">myscada.setItems('id','item1');<\/span><\/pre>\n","protected":false},"menu_order":126,"template":"","class_list":["post-65578","napoveda","type-napoveda","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/napoveda\/65578","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/napoveda"}],"about":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/types\/napoveda"}],"version-history":[{"count":0,"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/napoveda\/65578\/revisions"}],"wp:attachment":[{"href":"https:\/\/amit-automation.cz\/en\/wp-json\/wp\/v2\/media?parent=65578"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}