I am getting below error on our search screen.
This happens only when searched from specific field ( Group), if we search from any other field then we do not get this error.
ERROR:
kendo.web.js:5724 Uncaught TypeError: Cannot read property 'length' of undefined
SEARCHED FIELD:
<div class="col-md-3">
<div class="form-group">
@Html.LabelFor(model => model.Group)
@Html.EditorFor(model => model.Group, new { htmlAttributes = new { @class = "form-control", maxlength = 15, id = "Group" } })
</div>
</div>
KENDO.WEB.MIN.JS:
sort:function(e,t,n,i)
{
var r,o,s=a(e,t),
l=[];
if(n=n||Z,s.length)
{
for(r=0,o=s.length;r<o;r++)
l.push(n.create(s[r]));
return this.orderBy({compare:n.combine(l)},i)
}return this
},
VIEW:
@(Html.Kendo().Grid(Model)
.Name("SearchGrid")
.Columns(columns =>
{
columns.Bound(s => s.UserID).Visible(false).HtmlAttributes(new { id = "UserID" });
columns.Bound(s => s.SelectAll).ClientHeaderTemplate("<input id='selectall' class='chkbx' type='checkbox' onclick='ToggleChkBox(this.checked);'> Select All</>").ClientTemplate("<input type='checkbox' class='chkbxq' id='#= UserID #' />").Filterable(false).Sortable(false).Width(100).HtmlAttributes(new { style = "text-align:center" });
columns.Bound(s => s.UserName).Width(145).HtmlAttributes(new { id = "UserName" });
columns.Bound(s => s.FirstName).Width(165);
columns.Bound(s => s.LastName).Width(165);
columns.Bound(s => s.Email).Width(225);
})
.NoRecords(true)
.Pageable(pager => pager.PageSizes(new int[] { 10, 20, 30, 50 }))
.PersistSelection(true)
.Sortable()
.Events(events => events.Change("Grid_OnRowSelect"))
.Scrollable()
.Filterable()
.Selectable()
.AutoBind(true)
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Model(model => { model.Id(s => s.UserID); })
)
)