This is a migrated thread and some comments may be shown as answers.

kendo.web.js Uncaught TypeError: Cannot read property 'length' of undefined

1 Answer 483 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jagadeesh
Top achievements
Rank 1
Jagadeesh asked on 24 Aug 2020, 03:36 PM

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); })
            )
)

1 Answer, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 26 Aug 2020, 09:52 AM

Hello, Jagadeesh,

I noticed that you had submitted another, identical ticket to this one. This is why, I would like to ask you to continue the correspondence in the other thread, in order to avoid duplication. (Ticket ID: 1481846)

Thank you in advance for your cooperation.

Regards,
Nencho
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Jagadeesh
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Share this question
or