asp.net web api - Grid not binding json data - MVC Kendo UI Grid bound via Ajax to a WebAPI and OpenAccess ORM -
below sample of mvc kendo ui grid bound via ajax webapi. webapi uses openaccess orm data model. below code loads grid auto generated columns per model , webapi called , data returned in json given below.
the issue seems in grid data binding. data not visible in grid columns loaded successfully. missing in mvc code?
json data:
[{"dc_id":51234,"dataaccess_id":79238,"masterdata_flg":"y","input_type_cd":"qry","file_path":"d:\","descr":"aaa data capture","status":"a","created_by":"system","created_dttm":"01-jan-2013"},{"dc_id":79238,"dataaccess_id":79238,"masterdata_flg":"y","input_type_cd":"qry","file_path":"d:\","descr":"test data capture","status":"a","created_by":"system","created_dttm":"01-jan-2013"}]
mvc code:
@(html.kendo().grid<econverge.domainmodel.datacapture>() .name("grid") .columns(columns => { columns.autogenerate(true); }) .toolbar(tools => { tools.create(); }) //.sortable() //.pageable() //.filterable() .datasource(datasource => datasource .ajax() .model(model => { model.id(p => p.dc_id); }) .read(read => read.url("http://localhost/econ/econ.webapi/api/datacaptures").type(httpverbs.get)) .create(create => create.url("http://localhost/econ/econ.webapi/api/datacaptures").type(httpverbs.post)) .update(update => update.url("http://localhost/econ/econ.webapi/api/datacaptures").type(httpverbs.put)) .destroy(destroy => destroy.url("http://localhost/econ/econ.webapi/api/datacaptures").type(httpverbs.delete)) ) )
there more code required bind grid web api controller. recommend checking following resources:
http://www.kendoui.com/code-library/mvc/grid/binding-to-a-web-apicontroller.aspx
Comments
Post a Comment