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

StackOverflow https://stackoverflow.com/questions/22801896

Pergunta

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.

Foi útil?

Solução

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

Outras dicas

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top