javascript - DropDown is not populating in KENDO Grid -
i not able populating data in kendo dropdown data coming form database. here code kendo dropdown:
function positiondropdowneditor(container, options) { $('<input name="size" required data-bind="value:' + options.field + '"/>') .appendto(container) .kendodropdownlist({ autobind: false, datatextfield: "name", datavaluefield: "id", datasource: { transport: { read: { datatype: "json", url: "/employee/allposition", } } } }); }
and controller data coming from:
public jsonresult allposition() { employeeservice employeeservice = new employeeservice(); list<position> positions= employeeservice.getallposition(); return json(positions); }
whats wrong here data not populating inside dropdown? plz explain including "container, options" , value contain , why need use?
thank you
after concerning whole day , try, solved problem. hope others. silly, took whole day. found problem in allposition(). here return type sting. code be:
public string allposition() { employeeservice employeeservice = new employeeservice(); list<position> positions= employeeservice.getallposition(); var x = jsonconvert.serializeobject(positions); return x; }
dont ask me why return "jsonconvert.serializeobject(positions)" not return "json(positions)". had convert return type jsonresult string.
thanks concern , tried help.
Comments
Post a Comment