Editor controls disabled state
Lookup
MultiLookup
AjaxDropdown
RadioButtonList
CheckboxList
DropdownList
Combobox
Multiselect
Buttongroup
DateTimePicker
TimePicker
TextBox
Autocomplete
Disabled/Index.cshtml
<div id="disbDemo">
<div class="example">
<h3>Lookup</h3>
@(Html.Awe().Lookup("lkp")
.Controller("MealLookup")
.Value(Db.Meals[0].Id)
.ClearButton()
.Enabled(false))
</div>
<div class="example">
<h3>MultiLookup</h3>
@(Html.Awe().MultiLookup("mlkp")
.Controller("MealsMultiLookup")
.Value(new[] { Db.Meals[0].Id, Db.Meals[1].Id })
.ClearButton()
.Enabled(false))
</div>
<div class="example">
<h2>AjaxDropdown</h2>
@(Html.Awe().AjaxDropdown("add")
.Url(Url.Action("GetCategories", "Data"))
.Enabled(false))
</div>
<div class="example">
<h2>RadioButtonList</h2>
@(Html.Awe().RadioButtonList(new RadioButtonListOpt
{
Name = "rbl1",
Url = Url.Action("GetCategories", "Data"),
Value = Db.Categories[1].Id,
Enabled = false
}))
</div>
<div class="example">
<h2>CheckboxList</h2>
@(Html.Awe().CheckBoxList(new CheckBoxListOpt
{
Name = "chkbl1",
Url = Url.Action("GetCategories", "Data"),
Value = new[] { Db.Categories[0].Id, Db.Categories[1].Id },
Enabled = false
}))
</div>
<div class="example">
<h2>DropdownList</h2>
@(Html.Awe().DropdownList(new DropdownListOpt { Name = "odd", Url = Url.Action("GetCategories", "Data"), Value = Db.Categories[1].Id, Enabled = false }))
</div>
<div class="example">
<h2>Combobox</h2>
@(Html.Awe().Combobox(
new ComboboxOpt
{
Name = "combo1",
Url = Url.Action("GetCategories", "Data"),
Value = Db.Categories[1].Id,
Enabled = false
}))
</div>
<div class="example">
<h2>Multiselect</h2>
@(Html.Awe().Multiselect(
new MultiselectOpt
{
Name = "multi1",
Url = Url.Action("GetCategories", "Data"),
Value = new[] { Db.Categories[0].Id, Db.Categories[1].Id },
Enabled = false
}))
</div>
<div class="example">
<h2>Buttongroup</h2>
@(Html.Awe().ButtonGroup(
new ButtonGroupOpt
{
Name = "btng",
Url = Url.Action("GetCategories", "Data"),
Value = Db.Categories[1].Id,
Enabled = false
}))
</div>
<div class="example">
<h2>DateTimePicker</h2>
@(Html.Awe().DateTimePicker(
new DateTimePickerOpt
{
Name = "dtp",
Enabled = false,
ClearBtn = true,
Value = DateTime.Now
}))
</div>
<div class="example">
<h2>TimePicker</h2>
@(Html.Awe().TimePicker(
new TimePickerOpt
{
Name = "tmp1",
Enabled = false,
ClearBtn = true,
Value = DateTime.Now
}))
</div>
<div class="example">
<h2>TextBox</h2>
@Html.Awe().TextBox("txt1").Enabled(false).Numeric().Value(123)
</div>
<div class="example">
<h2>Autocomplete</h2>
@(Html.Awe().Autocomplete("autoc1")
.Enabled(false)
.Value("Mango")
.Url(Url.Action("MealAutocomplete", "Data")))
</div>
<div class="example">
<div class="efield">
<label>
@Html.Awe().Toggle(new ToggleOpt{ Name = "chk7", Enabled = false, Value= true})
<span class="o-con">Otoggl</span>
</label>
</div>
<div class="efield">
<label>
@Html.Awe().CheckBox(new CheckBoxOpt{ Name = "chk2", Enabled = false, Value = true})
<span class="o-con">Checkbox</span>
</label>
</div>
<div class="efield">
@Html.Awe().Button().Text("disabled").Enabled(false)
</div>
<div class="efield">
<button type="button" class="awe-btn" onclick="toggleEnable()">toggle enable all editors on page</button>
</div>
<script>
function toggleEnable() {
$('#disbDemo .awe-val').each(function () {
var o = $(this).data('o');
o.api.enable(!o.enb);
});
}
</script>
</div>
</div>
Comments