Hi Guys,
I am using the Combobox and it is giving me a javascript error. I have made sure JQuery is only included once and other Kendo controls are working.
Razor Code
@(Html.Kendo().ComboBox()
.Name("Projects")
.DataTextField("ProjectName")
.DataValueField("ProjectID")
.HtmlAttributes(new { style = "width:200px" })
.Filter("contains")
.AutoBind(false)
.MinLength(3)
.DataSource(source =>
{
source.Read(read => { read.Action("GetProject", "VMS"); }).ServerFiltering(true);
}))
Controller Code
public JsonResult GetProject([DataSourceRequest] DataSourceRequest request)
{
var model = _db.Project.ToList();
var result = model.ToDataSourceResult(request, r => new
{
ProjectID = r.ID,
ProjectName = r.Name,
});
return Json(result, JsonRequestBehavior.AllowGet);
}
JSON from fiddler
{"Data":[{"ProjectID":1,"ProjectName":"Project 1"},{"ProjectID":2,"ProjectName":"Project 2"},{"ProjectID":3,"ProjectName":"Project 3"}],"Total":3,"AggregateResults":null,"Errors":null}
Chrome error
Uncaught TypeError: undefined is not a function kendo.all.min.js:11
ct.extend.success kendo.all.min.js:11
b.isFunction.i jquery-1.9.1.js:7223
n.success kendo.all.min.js:11
c jquery-1.9.1.js:7341
p.fireWith jquery-1.9.1.js:7403
k jquery-1.9.1.js:9597
r
Thanks
Andrew
I am using the Combobox and it is giving me a javascript error. I have made sure JQuery is only included once and other Kendo controls are working.
Razor Code
@(Html.Kendo().ComboBox()
.Name("Projects")
.DataTextField("ProjectName")
.DataValueField("ProjectID")
.HtmlAttributes(new { style = "width:200px" })
.Filter("contains")
.AutoBind(false)
.MinLength(3)
.DataSource(source =>
{
source.Read(read => { read.Action("GetProject", "VMS"); }).ServerFiltering(true);
}))
Controller Code
public JsonResult GetProject([DataSourceRequest] DataSourceRequest request)
{
var model = _db.Project.ToList();
var result = model.ToDataSourceResult(request, r => new
{
ProjectID = r.ID,
ProjectName = r.Name,
});
return Json(result, JsonRequestBehavior.AllowGet);
}
JSON from fiddler
{"Data":[{"ProjectID":1,"ProjectName":"Project 1"},{"ProjectID":2,"ProjectName":"Project 2"},{"ProjectID":3,"ProjectName":"Project 3"}],"Total":3,"AggregateResults":null,"Errors":null}
Chrome error
Uncaught TypeError: undefined is not a function kendo.all.min.js:11
ct.extend.success kendo.all.min.js:11
b.isFunction.i jquery-1.9.1.js:7223
n.success kendo.all.min.js:11
c jquery-1.9.1.js:7341
p.fireWith jquery-1.9.1.js:7403
k jquery-1.9.1.js:9597
r
Thanks
Andrew