@{IDictionary<string, object> datepickerHtmlAttribute = new Dictionary<string, object>();
dataHtmlAttribute.Add("class", "e-disable");
}
@Html.EJ().ListView("checklist").ShowHeader(false).EnableCheckMark(true).Items(items =>
{
items.Add().Text("Artwork").Checked(true).HtmlAttributes(dataHtmlAttribute);
items.Add().Text("Abstract");
items.Add().Text("2 Acrylic Mediums").Checked(true).HtmlAttributes(datepickerHtmlAttribute);
items.Add().Text("Creative Acrylic");
items.Add().Text("Modern Painting");
items.Add().Text("Canvas Art");
items.Add().Text("Black white");
items.Add().Text("Children");
}).ClientSideEvents(evt => evt.Create("onCompleteLoad"))
<script>
function onCompleteLoad() {
var obj = $("#checklist").ejListView("instance");
//obj.checkAllItem();
//obj.option("checkedIndices", [2, 3]);
obj.disableItem(0)
obj.disableItem(1)
obj.enableItem(0);
obj.enableItem(1);
};
</script> |