I'm looking to show/hide the "require input" asterisk (*) once a value is not selected/selected. Is there a way to do this with MultiSelect? I see that there are onSelectAll & onDeselectAll but there's no function that handles onSelect of any value -- how would I handle this with MultiSelect?
My current markup:
<div id=
"@(Model.Name + "
InitialLoading
")"
class
=
"CheckboxListInitializing"
><img style=
"height: 13px;margin-right: 5px;"
src=
"../Content/images/loading.gif"
>Loading...</div>
<span id=
"@(Model.Name + "
Loading
")"
style=
"display:none;position: absolute;"
>
<img src=
'../Content/kendo/2016.1.406/Bootstrap/loading.gif'
/>
</span>
<script>
$(function ()
{
$(
"#@(Model.Name)"
).multiselect({
includeSelectAllOption:
true
//, selectAllValue: "[All]"
, selectAllText:
"(Select All)"
, enableFiltering:
true
, enableCaseInsensitiveFiltering:
true
, onDropdownShown: function (
event
) {
this
.$select.parent().find(
"button.multiselect-clear-filter"
).click();
this
.$select.parent().find(
"input[type='text'].multiselect-search"
).focus();
$(
".@(Model.ItemName)"
).hide();
}
, nonSelectedText:
" "
, onInitialized: function () { $(
"#@(Model.Name)InitialLoading"
).hide(); $(
".@(Model.ItemName)"
).hide(); }
, onChange: function () { ListChangeHandler( $(
"select[id=@Model.Name]"
));}
, onSelectAll: function () { ListChangeHandler( $(
"select[id=@Model.Name]"
)); $(
".@(Model.ItemName)"
).hide();}
, onDeselectAll: function () { ClearWholeList($(
"select[id=@Model.Name]"
)); ListChangeHandler($(
"select[id=@Model.Name]"
)); $(
".@(Model.ItemName)"
).show(); }
@*@(!
string
.IsNullOrEmpty(Model.ChangeHandler) ?
", onChange: "
+ Model.ChangeHandler +
", onSelectAll: "
+ Model.ChangeHandler +
", onDeselectAll: "
+ Model.ChangeHandler :
""
)*@
});
LoadListBox(
"@(!string.IsNullOrEmpty(Model.CascadedFromName) ? Model.Name : "
")"
);
})
</script>