How to pass MongoDb Json value to KendoUI grid using webservice method

只谈情不闲聊 提交于 2019-12-11 09:50:16

问题


I'm new to KendoUI, trying to populate a KendoUI grid with JSON data which is fetched from mongoDB as BsonDocument lsit and returned as JSON string,

var ds = new kendo.data.DataSource({
 transport: {
       read: {
            url: "WebService.asmx/GetJson",
            dataType: "json",
            data: {
                 q: "data"
              }
            }
        },
        schema: {
            data: "statuses"
        }
    });

    $("#grid").kendoGrid({

        dataSource: ds
    });

I tried this one, grid is not binding to me, was I'm doing wrong, how to bind my data to grid, pls help me waiting for kind reply.

note: Grid should not be defined structure with column fields, based on Json string grid structure has to changed.


回答1:


I think you're probably trying to do too many things at once if you're new to KendoUI. Try just binding the grid to some static data (hard coded into the web page) that looks exactly like the data from MongoDB first... You should be able to extract this from MongoDB easily enough using something like MongoVue.

Once you're sure the data itself is in the right format and the grid is configured to use this properly, then try setting up a remote url or web service to fetch the data and make sure that the data retrieved from the remote url is what you're expecting.

Finally, when you have both of those pieces of the puzzle in place, you should look at hooking the KendoUI grid up to the remote web service.



来源:https://stackoverflow.com/questions/17739729/how-to-pass-mongodb-json-value-to-kendoui-grid-using-webservice-method

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!