or
<div class="DCF"> @using (Html.BeginForm("Search", "Search", FormMethod.Post, new { enctype = "multipart/form-data" })) { <span>DCF DB</span> @(Html.Kendo().AutoComplete() .Name("dcfSearchBox") //.DataTextField("results") //commented as the list of strings do not need a dataTextField defined to display .Filter("contains") .MinLength(3) .HtmlAttributes(new { style = "width:250px" }) .DataSource(source => { source.Read(read => { read.Action("SuggestionSearch", "Search").Data("onAdditionalData"); }) .ServerFiltering(true); }) .Template("#:results.Replace(dcfSearchBox.val(),\"<span style='font-weight: bold;'>#:dcfSearchBox.val()</span>\")#") ) <br /> @(Html.Kendo().Button() .Name("btnSubmit") .HtmlAttributes(new { type = "submit" }) .Content("Search") ) }</div><script> function onAdditionalData() { return { text: $("#dcfSearchBox").val()//, //checkFilter: $("#dcfCheckFilter").is(':checked'), //filterText: $("#dcfFilterText").val() }; }</script>.Columns(columns => { columns.Template(e => { }).ClientTemplate(" ").Title("Store Name"); columns.Bound(c => c.Value).Format("R {0:n2}"); columns.Bound(c => c.Quantity).Format("{0:n0}"); columns.Bound(c => c.ASP).Format("R {0:n2}"); }) .HtmlAttributes(new { style = "height: 900px;" }) .Events(ev => ev.DataBound("onDataBound")) .ClientRowTemplate( "<tr data-uid='#: uid #'>" + "<td ><a href='/Dashboard/Store/#= StoreId #'>" + "#: Element #" + "</a></td>" + "<td class='text-right' >R " + "#: Value #" + "</td>" + "<td class='text-right'>" + "#: Quantity #" + "</td>" + "<td class='text-right' >R " + "#: ASP #" + "</td>"+ "</tr>" )<input id="..." name="..." class="post-retirement" data-show-buttons="false" data-role="slider" data-min="0" data-max="2" data-small-step="0.01" value="" data-value="" data-bind="visible: isVisible, events: { change: onChange }" data-index="@i" data-tooltip="{format: '{0:p0}'}" data-toggle="tooltip" /><input id="..." name="..." class="weight-split" data-show-buttons="false" data-role="slider" data-min="0" data-max="1" data-small-step="0.01" value="" data-value="" data-bind="visible: isVisible, events: { change: onChange }" data-index="@i" data-tooltip="{format: '{0:p0}'}" data-toggle="tooltip" />//activate tooltips$("[data-toggle=\"tooltip\"]").tooltip();var postRetirementViewModel = kendo.observable({ isEnabled: true, isVisible: true, onChange: function (e) { //get the index for this row var index = $(e.sender.element).data("index"); //removed for brevity }});var weightSplitViewModel = kendo.observable({ isEnabled: true, isVisible: true, onChange: function (e) { //removed for brevity }});kendo.bind($(".post-retirement"), postRetirementViewModel);kendo.bind($(".weight-split"), weightSplitViewModel);
