Hi,
we're using SmartGWT version 2.5 and have there following problem:
There is a listgrid with one column of date type and have assigned datasource with 1 date field, datesource extends RestDataSource and uses server for retrieving data.
When data are fetch and I call getRecords()[0].getAttributeAsDate("date"), error occurs and when I call only getAttribute("date") string value is get instead of serialized date.
When data are set from client and set record in data contains attribute "date" as object Date, getAttribute and getAttributeAsDate return correct value
ListGrid:
[CODE]
TestDateGrid dateGrid = new TestDateGrid();
dateGrid.fetchData();
dateGrid.getRecord(0).getAttributeAsDate("date"); // exception is thrown - ret.getTime is not a function
[CODE]
response from server:
Can you please advice me what we're doing wrong? This issue is quite urgent for us.
thanks
we're using SmartGWT version 2.5 and have there following problem:
There is a listgrid with one column of date type and have assigned datasource with 1 date field, datesource extends RestDataSource and uses server for retrieving data.
When data are fetch and I call getRecords()[0].getAttributeAsDate("date"), error occurs and when I call only getAttribute("date") string value is get instead of serialized date.
When data are set from client and set record in data contains attribute "date" as object Date, getAttribute and getAttributeAsDate return correct value
ListGrid:
Code:
public class TestDateGrid extends ListGrid { public TestDateGrid() { RestDataSource ds = new RestDataSource(); ds.setID("TESTDS"); DataSourceDateField dateField = new DataSourceDateField("date", "DATE"); ds.setFields(dateField); this.setDataSource(ds); } }
TestDateGrid dateGrid = new TestDateGrid();
dateGrid.fetchData();
dateGrid.getRecord(0).getAttributeAsDate("date"); // exception is thrown - ret.getTime is not a function
[CODE]
response from server:
Code:
{ "response": { "totalRows": 1, "data": [ { "date": "2011-09-30" } ], "status": 0, "startRow": 0, "endRow": 1 } }
thanks
Comment