csen

Často kladené otázky

Using components in view scripts

You can easily use the List box, combo box and text box in view scripts.

We will start with a simple example showing how to use the combo box programmatically:

1. We will create the combo box and add it to the view.

2. We will create a button next to the combo box, on its press we will call view script function get Item.

getitem

onclick

3. In getItem fuction, we will get value of selected component

var selItem = myscada.getSelectedItem('Comp29328366');

‘Comp29328366’ is an ID of our Combo box. You can find ID in properties window upon clicking on your Combo box.

Once we get the selected item, we will show it by calling alert(selItem);

8.3.3

4. Now we will create a new button. On its press we will call view script function setItem where we will set item in combo box to second item.

8.3.4

Callback function example:

If you want to be notified, when user selects an item in the combo box or list box, or presses and enters into the text box, set up a callback function.

1. Define your callback function in View Script

8.3.5

As you can see, into your callback function, you will get 2 arguments, first is a selected item and second is an index of the selected item.

2. Click on your component in view and fill in the callback function name

8.3.6

3. When user selects an item, your callback function will be called

8.3.7

Setting new values into Components Programmatically

You can easily change the items in your component programmatically. To do so, you can use function setItems:

var items = ['item 1','item 2'];
myscada.setItems('id',items);

Coloring items in List Box

List box allow you to fine tune appearance of each item by specifying the colors and bold face of the font. To do so, use function setItems. Passed items in array will not be strings but objects with additional properties. Simple Example:

8.3.8

Will produce following output

output

Nenašli jste co jste hledali?

Kontaktujte nás.
ZAVOLEJTE
  • +420 541 217 220
Nebo nám napište a my se ozveme.
  • Obchodní oddělení
  • Technická podpora
  • Servis/Reklamace
  • Webmaster

AMiT Automation s.r.o.

  • info@amit-automation.cz
  • +420 541 217 220
    +420 549 210 403
    +420 549 210 276

Vídeňská 186/118


619 00 Brno


Česká republika

IČO: 276 52 203


DIČ: CZ27652203

Česká rada pro šetrné budovy

MODERNÍ ELEKTRONIKA PRO PRŮMYSLOVOU AUTOMATIZACI A AUTOMATIZACI BUDOV

Copyright © — AMiT Automation
Přihlášení a registrace
Registrací souhlasíte s našimi obchodními podmínkami a se zpracováním osobních údajů.

We often send out our newsletter with news and great offers. We will never disclose your data to third parties and you can unsubscribe from the newsletter at any time.

Unfortunately, we’re unable to offer free samples. As a retailer, we buy all magazines from their publishers at the regular trade price. However, you could contact the magazine’s publisher directly to ask if they can send you a free copy.

You can create a new account at the end of the order process or on the following page. You can view all of your orders and subscriptions in your customer account. You can also change your addresses and your password.

No, you don’t have to create an account. But there are a few advantages if you create an account.

  • You never have to enter your billing and shipping address again

  • Find all of your orders, subscriptions and addresses in your account

  • Download invoices of your orders

No, we don’t have a physical store location at the moment. We accept only orders through our online shop and we’re shipping all orders with the Swiss Post Service. Please visit our shipping section for more details.

From time to time you will find us at design fairs and popup markets in Switzerland. Subscribe to our newsletter and you’ll receive the latest news.

Tab Content

This is a basic text element.
Smazat účet?
Určitě si přejete smazat účet?

Tuto akci nelze vrátit zpět.
Fakturační a doručovací údaje

Pro zobrazení tohoto formuláře se musíte přihlásit.

Zapomenuté heslo

Zadejte svůj e-mail, na který vám zašleme odkaz pro obnovení hesla.

Přihlášení a registrace
Registrací souhlasíte s našimi obchodními podmínkami a se zpracováním osobních údajů.

We often send out our newsletter with news and great offers. We will never disclose your data to third parties and you can unsubscribe from the newsletter at any time.

Unfortunately, we’re unable to offer free samples. As a retailer, we buy all magazines from their publishers at the regular trade price. However, you could contact the magazine’s publisher directly to ask if they can send you a free copy.

You can create a new account at the end of the order process or on the following page. You can view all of your orders and subscriptions in your customer account. You can also change your addresses and your password.

No, you don’t have to create an account. But there are a few advantages if you create an account.

  • You never have to enter your billing and shipping address again

  • Find all of your orders, subscriptions and addresses in your account

  • Download invoices of your orders

No, we don’t have a physical store location at the moment. We accept only orders through our online shop and we’re shipping all orders with the Swiss Post Service. Please visit our shipping section for more details.

From time to time you will find us at design fairs and popup markets in Switzerland. Subscribe to our newsletter and you’ll receive the latest news.

Tab Content

This is a basic text element.
Přidat do seznamu
+ Přidat nový seznam