c# - row is missing while binding to Kendo ui grid -
i have table called user account. have values follows:
[{"amount":17.0000,"dateoftransaction":"/date(1422815400000+0530)/","useraccountid":12,"useraccounttype":"useraward","userpoints":150}, {"amount":3.1700,"dateoftransaction":"/date(1431596225417+0530)/","useraccountid":44,"useraccounttype":"userorder","userpoints":32}, {"amount":15.0000,"dateoftransaction":"/date(1432625433707+0530)/","useraccountid":53,"useraccounttype":"userorder","userpoints":150}]"
i trying displaying these values using kendo ui grid. among these, last 2 rows displaying. first row missing have user account type "user award".
values return server having 3 rows. @ time of binding shows last 2 rows.
here code:
$("#transactions-grid").kendogrid({ datasource: { transport: { read: "/customercall/getusertransactionshistory/" + $('#systemuserid').val(), }, total: function () { console.log(response.data); return response.data.length; }, schema: { model: { fields: { useraccounttype: { type: "string" }, userpoints: { type: "number" }, amount: { type: "number", format: "{0:c2}" }, dateoftransaction: { type: "date", format: "{0:dd-mm-yyyy}" } } }, errors: function (e) { console.log(e); } }, pagesize: 5, serverpaging: false, serverfiltering: false, serversorting: false }, filterable: false, sortable: true, pageable: true, detailinit: detailinit, databound: function () { this.expandrow(this.tbody.find("tr.k-master-row").first()); }, scrollable: true, columns: [{ field: "useraccounttype", title: "transaction type", lockable: false, width: 100 }, { field: "userpoints", title: "user points", lockable: false, width: 80 }, { field: "amount", title: "amount", lockable: false, width: 80 }, { field: "dateoftransaction", title: "transaction date", lockable: false, width: 80, template: "#= kendo.tostring(kendo.parsedate(dateoftransaction, 'yyyy-mm-dd'), 'dd/mm/yyyy') #" }, { template: '<button class="btn btn-sm btn-white" data-useraccountid="#=useraccountid#">details</button>', title: "action", lockable: false, width: 55 }], databound: function () { var rows = this.items(); var index = 0; $(rows).each(function () { alert("success"); index = index + 1; }); if (index > 0) { $("#filtered-transactions").show(); } } }); }); controller is: [httpget] public partialviewresult getusertransactionssummary(int id) { var result = _systemuserservice.getusertransactionhistory(new businessobjects.messaging.useraccounts.getusertransactionhistoryrequest(id)); var modal = _mappingservice.map<usertransactionhistorydto, employeedetailswithpointsvm>(result.usertransactionhistory); modal.jsonusertransactionhistory = jsonhelper.jsonserializer<list<useraccountvm>>(modal.usertransactionhistory); return partialview("getusertransactionssummary", modal); }
i dont why row missing. how shall check error of missing row?
Comments
Post a Comment