HI
I met a error about Grid :
Uncaught TypeError: Cannot read property 'get' of null
I have test my code and found that the Selectable(true) will cause this error :
View
@(Html.Kendo().Grid(Model.ListProperty1)
.Name("ListProperty1Grid")
.Selectable(selectable =>
{
selectable.Enabled(true);
})
Javascript
var grid;
var dataSource;
//
dataSource = new kendo.data.DataSource(
{
data: ...
});
//
grid = $("#ListProperty1Grid").data("kendoGrid");
grid.setDataSource(dataSource);
Grid's BUG ?
*Telerik DevCraft UI for ASP.NET MVC R2 2017 SP1
*jquery-2.2.4.js
*jquery-2.2.4.js
*jquery-2.2.4.js
VM22852:93 Uncaught TypeError: Cannot read property 'get' of null
at makeWidgetInfo (<anonymous>:93:44)
at <anonymous>:552:33
function makeWidgetInfo(w, extended) {
var el = w.wrapper || w.element;
var ret = {
id : cacheObject(w),
type : w.options.name,
prefix : w.options.prefix,
events : w.events && w.events.length > 0 ? w.events.map(function(evname){
return makeSpecial("doclink-event", {
event : evname,
widget : w.options.name,
prefix : w.options.prefix,
});
}) : undefined,
element_tag : w.element.get(0).tagName, <<< ====== Uncaught TypeError: Cannot read property 'get' of null
element_id : w.element.attr("id"),
element_class : w.element.attr("class"),
visible : el.is(":visible"),
hasModel : !!w.dataSource,
wasInspected : w === window.$K,
};
if (typeof w.value == "function") {
ret.value = tools.safeValueForJSON(w.value());
}
if (extended) {
ret.widget = tools.safeValueForJSON(w);
ret.element = tools.safeValueForJSON(w.element.get(0));
if (w.wrapper) {
ret.wrapper = tools.safeValueForJSON(w.wrapper.get(0));
}
}
return ret;
}
Best regards
Chris