combo
| Name space |
rialto.widget |
| FILE |
rialtoEngine\javascript\components\controls\combo.js |
| NAME |
combo |
| INHERITS |
AbstractComponent
|
| VERSION |
0.86 |
| update |
|
| DESCRIPTION |
This object create a create a drop-down area which lists elements |
CONSTRUCTOR
| Name |
Type |
Description |
Default |
| tabData |
Array |
table of couple value/text where the text is the one to display and value represents a code associated |
|
| Name |
String |
Name of the HTML element |
|
| top |
int |
Top position (in pixel) |
0 |
| left |
int |
Left position (in pixel) |
0 |
| width |
String |
Width (in pixel or %) |
100% |
| parent |
String or reference |
Reference of an HTML or a javascript element parent of the combo html element |
|
| objPar.suggest |
boolean |
suggest on key press |
true |
| objPar.heightItem |
int |
height of an item in the list |
23 |
| objPar.enable |
boolean |
initial enable state |
true |
Example:
var comb = new rialto.widget.Combo([["value1","text1"],["value2","text2"],["value3","text3"]],"MyComb",5,10,100,CADRE2,{position:"absolute",heightItem:25,suggest:false,enable:true});
PUBLIC METHODS
setData
To set a new array of data
Parameters:
Array tabData:table of couple value/text where the text is the one to display and value represents a code associated
addItem
add a new item in the combo list
Parameters:
String value:value of the new item
String text:text of the new item
setEnable
this method will allow to enable or disable the combo according to the parameter
Parameters:
boolean isEnable:True to enable
selFirst
allow to select the first element of the combo list
Parameters:
selLast
allow to select the last element of the combo list
Parameters:
selInd
allow to select a element of the combo list passing his index
Parameters:
int index:index of the item in the combo list
selWithValue
allow to select a element of the combo list passing his value
Parameters:
string value:value of the item we want to select
boolean execAppliCode:if true execute the onclick applicative code
selWithText
allow to select a element of the combo list passing his text
Parameters:
string value:text of the item we want to select
boolean execAppliCode:if true execute the onclick applicative code
setValue
set value in the combo (no control with item list)
Parameters:
string text:text to display in the combo
indexOf
return the first index of the item having this value (-1 if not)
Parameters:
string value:value of the item we are looking for
indexOfText
return the first index of the item having this text (-1 if not)
Parameters:
string text:text of the item we are looking for
setEnable
this method will allow to enable or disable the combo according to the parameter
Parameters:
boolean isEnable:True to enable
setFocus
this method will allow to give the focus to the combo
Parameters:
getSelValue
return the value of the select item
Parameters:
getSelText
return the text of the select item
Parameters:
getValue
return the value associated of the item having this index
Parameters:
int ind:index of the item we want the value
getText
return the text associated of the item having this index
Parameters:
int ind:index of the item we want the text
onclick
this method will be raise afert selecting an item of the combo.The parameter represents the value and the text of this item.
Parameters:
String value:value of the selected item
String text:text of the selected item
The code must be redefine after the instanciation of the component. By default this method does nothing.