ghufranne
ghufranne

Reputation: 919

Slickgrid is not displaying data using dataview but when I use data array it is displaying data?

I am using ajax with jQuery, in 'success'callback, I am able to get the data in JSON type, I want to display it using slickgrid, when I pass data array in the slickgrid api constructor I am able to dsipaly it in the grid, but when I use DataView I am not able to display it in the grid, though grid is displayed but data is not populated in the grid. Any help would be greatly appreciate. Thanks.

Upvotes: 0

Views: 1027

Answers (2)

ghufranne
ghufranne

Reputation: 919

Actually for displaying json in slickgrid, json must have a field 'id' which should be unique.

Upvotes: 2

David Moore
David Moore

Reputation: 48

Without seeing the code, it will be hard to diagnose. Did you use the setItems method on DataView?

// This will fire the change events and update the grid.
dataView.setItems(data);

This is from the DataView section on the SlickGrid docs: https://github.com/mleibman/SlickGrid/wiki/DataView

By using setItems, DataView knows that the data changes, and will take the appropriate steps to update the grid.

Upvotes: 0

Related Questions