data
Optional. Specifies an array of data objects to set into the combobox
data?: object[];
Parameters:
Each object in the data set contains a number of key:value pairs that represent attributes of Combo options. The available attributes are:
id?: string | number
- optional, the id of the data optionvalue?: string
- optional, the text value of the optionsrc?: string
- optional, the path to the imageicon?: string
- optional, the CSS class of the displayed icon (for example, "dxi dxi-check")
info
It is not possible to use the src
and icon
attributes together.
Example
const combo = new dhx.Combobox("combo_container",{
data: [
{
"value": "Austria",
"src": "../common/flags/at.png"
},
{
"value": "Belgium",
"src": "../common/flags/be.png"
},
{
"value": "Bulgaria",
"src": "../common/flags/bg.png"
},
{
"value": "Cyprus",
"src": "../common/flags/cy.png"
}
]
});
Related sample: Combobox. Initialization with config.data
Change log:
added in v6.4