I ve data in the JSON format given below,need to populate the slick grid columns with the data from cols and rows from values.. Could u please help me with the loops required to do so ....
var response = { "cols" : ["name", "Precentage", "Year", "Amount"],
"rows": [{
"flag": true,
"values": [" name1", "Precentage1", "year1", "Amount1"]
}
There may be a better way to do this, but you could just loop through and build the data array by hand, something like this:
You can then use
grid.setData(data)
to pass the data into the grid.