ColorDropdown
The ColorDropdown Control allows users to select a color from a pre-defined list of color options. Color options can be defined by setting the DataFunc property.
ColorDropdown/Index.cshtml
@(Html.Awe().ColorDropdown(new ColorDropdownOpt { Name = "ColorPicker1", AutoSelectFirst = true }))
Custom colors
ColorDropdown/Index.cshtml
@(Html.Awe().ColorDropdown(
new ColorDropdownOpt {
Name = "ColorPicker2",
DataFunc = "customColors",
ClearBtn = true
}))
<script>
function customColors(){
return [{ k: 'green' }, { k: 'purple' }, { k: 'yellow' }, { k: '#2196f3' }, { k: '#ff5722' }];
}
</script>
Comments