In a Grid, I have a column "Date", and when I want to sort this column, the dates sort correctly in host mode but do not sort correctly with Firefox or IE.
It was OK with version 1.1.1 but not with 1.2.3.
In a Grid, I have a column "Date", and when I want to sort this column, the dates sort correctly in host mode but do not sort correctly with Firefox or IE.
It was OK with version 1.1.1 but not with 1.2.3.
for me work fine
look http://www.extjs.com/explorer/#editablegrid
post the code example
work fine in host mode, but not in firefox or IE.Code:public class NewTabItem extends TabItem { private GroupingStore<BaseModel> gridStore; public NewTabItem (List<BaseModel> dates) { super(); List<ColumnConfig> columns = new ArrayList<ColumnConfig>(); ColumnConfig date = new ColumnConfig("Date", "Released", 80); date.setDateTimeFormat(DateTimeFormat.getFormat("MMMM dd, yyyy")); columns.add(date); final ColumnModel cm = new ColumnModel(columns); final GroupingView view = new GroupingView(); view.setForceFit(true); view.setGroupRenderer(new GridGroupRenderer() { public String render(GroupColumnData data) { String l = data.models.size() == 1 ? "Item" : "Items"; return data.group + " (" + data.models.size() + " " + l + ")"; } }); gridStore = new GroupingStore<BaseModel>(); gridStore.add(dates); Grid grid = new Grid<BaseModel>(gridStore, cm); grid.setLoadMask(true); grid.setBorders(true); grid.setView(view); setLayout(new FitLayout()); setStyleAttribute("margin", "8px 0 0 0"); add(grid); } }
see image : (Dates are sorted in DESC...)
![]()
look http://extjs.com/deploy/gxtdocs/com/...eTimeFormat%29 test with this
Sorry, it's DateTimeFormat.getFormat("MMMM dd, yyyy"); in my code
but it's not the problem. The result is the same.
Same problem for me.
Have a column configuration with DateTimeFormat specified.
Grid sorts it as a string rather than a date
it's not the problemlook http://extjs.com/deploy/gxtdocs/com/...eTimeFormat%29 test with this
GXT 1.1.1 :
- Host mode : OK
- IE : OK
- Firefox : OK
GXT 1.2.3 :
- Host mode : OK
- IE : ERROR
- Firefox : ERROR
With the same code for 1.1.1 and 1.2.3
WHY ?
I am having the same issue in GXT 2.0.1. Did you ever get this resolved?
Looks like a GWT bug
http://code.google.com/p/google-web-...00&q=compareto
Basic issue is that the compareTo method in java.sql.Timestamp is broken. If you are returning Timestamp objects from the backend you will run into this issue.
We wound up creating our own local copy of the emulated Timestamp class and changing the compareTo method to
Code:public int compareTo(Timestamp o) { /* int delta = (int) (getTime() - o.getTime()); return delta == 0 ? getNanos() - o.getNanos() : delta; */ int i = super.compareTo(o); if (i == 0) { if (getNanos() > o.getNanos()) { return 1; } else if (getNanos() < o.getNanos()) { return -1; } } return i; }