When I bind Json data to slickgrid using ajax call it works but when I bind using dataview it shows "Title" error Here is my code can any one help me
Edit:When I remove setItem(slickdata) grid is displayed but data is not populated and this my json data format
[{ "empid": 1, "fname": "John", "lname": "Doe", "email": "jdoe@gmail.com", "sdate": "4/3/2012" },
{ "empid": 2, "fname": "Stuart", "lname": "Motzart", "email": "jdoe@gmail.com", "sdate": "4/3/2012" }]
var jqxhr = $.getJSON('http://localhost:50305/Service1.svc/json/Projects', function (data) {
for (var i = 0; i < data.length; i++) {
slickdata[i] = {
empid: data[i].empid,
fname: data[i].fname,
lname: data[i].lname
};
}
dataView.beginUpdate();
dataView.setItems(slickdata);
dataView.endUpdate();
grid = new Slick.Grid("#teamGrid", dataView, columns, options);
dataView.onRowCountChanged.subscribe(function (e, args) {
grid.updateRowCount();
grid.render();
});
dataView.onRowsChanged.subscribe(function (e, args) {
grid.invalidateRows(args.rows);
grid.render();
});
})
.done(function () {
console.log("second success");
})
.fail(function () {
alert("fail");
console.log("error");
})
.always(function () {
console.log("complete");
});