Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Dates Parsing in DataSource.fetchData

    I have a piece of code that returns an array of object in JSON format in response to a dataSource.fetchData call. The data contains dates in yyyy-mm-dd format and has been working correctly (ie, the returned date strings are being parsed into date objects when I call myGrid.setData(data))

    Now I need to change the response by adding a flag to indicate not all values were read. I changed the code on the server to return a JSON object with a boolean "more" property and a "data" property that holds the array of objects.

    I have tried changing the call to myGrid.setData to pass it the array from within the object. I have also tried adding a transformRequest function to the datasource that modifies the data object by replacing it with just the array. In both cases I can get the data to appear in the grid but the dates are no longer being parsed. They are simply strings now.

    How can I implement this? Would I be better off using a RestDataSource even though the status I am passing back is not a recognized REST status?

    Thanks
Working...
X