tabalinas/jsgrid-webapi

Cannot read property "Username"

开放

#11 创建于 2018年3月20日

 (1 条评论) (0 个反应) (0 位负责人)C# (23 个派生)github user discovery
help wanted

仓库指标

星标
 (38 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

Hi,

Code snippet I'm using to display the data

https://github.com/tabalinas/jsgrid-webapi/blob/b25118d6b6ae41760fa08455b1050e8c57e9901e/Views/Home/Index.cshtml

$("#jsGrid").jsGrid({
            height: "50%",
            width: "100%",

            filtering: true,
            inserting: true,
            editing: true,
            sorting: true,
            paging: true,
            autoload: true,

            pageSize: 10,
            pageButtonCount: 5,

            deleteConfirm: "Do you really want to delete client?",

            controller: {
                loadData: function(filter) {
                    return $.ajax({
                        type: "GET",
                        url: "/api/data",
                        data: filter,
                        dataType: "json"
                    });
                }, ....

I'm getting this error when i F12 on browser and no data is displayed as it doesn't recognize the db col

jquery-3.3.1.js:3818 jQuery.Deferred exception: Cannot read property 'Username' of undefined TypeError: Cannot read property 'Username' of undefined at d._getItemFieldValue (http://js-grid.com/js/jsgrid.min.js:7:11362) at d._createCell (http://js-grid.com/js/jsgrid.min.js:7:11092) at d. (http://js-grid.com/js/jsgrid.min.js:7:11027) at c. (http://js-grid.com/js/jsgrid.min.js:7:7686) at Function.each (http://localhost:50692/Scripts/jquery-3.3.1.js:354:19) at d._eachField (http://js-grid.com/js/jsgrid.min.js:7:7642) at d._renderCells (http://js-grid.com/js/jsgrid.min.js:7:10990) at d._createRow (http://js-grid.com/js/jsgrid.min.js:7:10391) at d._refreshContent (http://js-grid.com/js/jsgrid.min.js:7:9988) at d.refresh (http://js-grid.com/js/jsgrid.min.js:7:9425) undefined jQuery.Deferred.exceptionHook @ jquery-3.3.1.js:3818 jquery-3.3.1.js:3827 Uncaught TypeError: Cannot read property 'Username' of undefined at d._getItemFieldValue (jsgrid.min.js:7) at d._createCell (jsgrid.min.js:7) at d. (jsgrid.min.js:7) at c. (jsgrid.min.js:7) at Function.each (jquery-3.3.1.js:354) at d._eachField (jsgrid.min.js:7) at d._renderCells (jsgrid.min.js:7) at d._createRow (jsgrid.min.js:7) at d._refreshContent (jsgrid.min.js:7) at d.refresh (jsgrid.min.js:7)

Thanks for the help!

贡献者指南