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

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

سؤال

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.

هل كانت مفيدة؟

المحلول

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

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top