I have below piece of code and trying to populate my slickgrid with json data which my webservice returns. but the grid is not getting populated. The data returned is empty as i see nothing comming in alert window.
$(function ()
{
var slickdata = [];
$.getJSON("comm/j/abc?action=hi", function(data)
{
// data is a JavaScript object now. Handle it as such
for (var i=0;i<data.length;i++)
{
alert("slickdata i" );
slickdata[i] =
{
month: data[i].month,
teamed: data[i].teamed,
net: data[i].net
};
}
});
alert(slickdata);
// dataView = new Slick.Data.DataView({ inlineFilters: true });
grid = new Slick.Grid("#myGrid", slickdata, columns, options);
// grid.setSelectionModel(new Slick.RowSelectionModel());
})
Output of my service call below (JSONData)
{
p: {
month: "May-2014",
teamed: "Y",
net: 100000
}
}
No error is displayed at console