Basic #
This is the most basic usage of RegateDropdown
.
Regate.RegateDropdown.init({
id: 'basic-example',
name: 'Fruit',
options: [
{ key: '1', value: 'Apple' },
{ key: '2', value: 'Orange' },
{ key: '3', value: 'Banana' },
]
})
@Html.Raw(RegateDropdown.Build<FruitsEnum>("Fruit"))
Value #
Regate.RegateDropdown.init({
id: 'value-example',
name: 'Fruit',
value: '2',
options: [
{ key: '1', value: 'Apple' },
{ key: '2', value: 'Orange' },
{ key: '3', value: 'Banana' },
]
})
@Html.Raw(RegateDropdown.Build<FruitsEnum>("Fruit", FruitsEnum.Orange))
Required #
Regate.RegateDropdown.init({
id: 'required-example',
name: 'Fruit',
isRequired: true,
options: [
{ key: '1', value: 'Apple' },
{ key: '2', value: 'Orange' },
{ key: '3', value: 'Banana' },
]
})
@Html.Raw(RegateDropdown.Build<FruitsEnum>("Fruit", isRequired: true))
Placeholder #
Regate.RegateDropdown.init({
id: 'placeholder-example',
name: 'Fruit',
placeholder: 'Please choose a fruit',
options: [
{ key: '1', value: 'Apple' },
{ key: '2', value: 'Orange' },
{ key: '3', value: 'Banana' },
]
})