I have a problem with ListGrid filter row date format. I'm setting proper format for field but filter editor has it's own format. Do i need to set it manually? How to do it? I want to use custom format so none of DateDisplayFormat patterns suit my needs.
The second question is how to tell ListGrid to show date range dialog instead of simple picker?
Im using smartgwt-lgpl 6.0-p20161016
The second question is how to tell ListGrid to show date range dialog instead of simple picker?
Im using smartgwt-lgpl 6.0-p20161016
Code:
public static final int RECORD_COUNT = 5; public void onModuleLoad() { ListGrid grid = new ListGrid(); grid.setShowFilterEditor(true); grid.setFilterLocalData(true); grid.setWidth(600); grid.setHeight(400); ListGridField lgf1 = new ListGridField("F1", "Field 1", 100); lgf1.setType(ListGridFieldType.DATE); lgf1.setFormat("yyyy-MM-dd"); lgf1.setCanFilter(true); ListGridField lgf2 = new ListGridField("F2", "Field 2", 100); lgf2.setType(ListGridFieldType.DATE); lgf2.setFormat("yyyy.MM.dd"); lgf2.setCanFilter(true); ListGridField lgf3 = new ListGridField("F3", "Field 3", 100); lgf3.setType(ListGridFieldType.DATE); lgf3.setFormat("yyyy - MM - dd"); lgf3.setCanFilter(true); grid.setFields(lgf1, lgf2, lgf3); grid.setData(getData()); RootPanel.get("listGridContainer").add(grid); } private ListGridRecord[] getData() { ListGridRecord[] listGridRecords = new ListGridRecord[RECORD_COUNT]; for (int i = 0; i < RECORD_COUNT; i++) { listGridRecords[i] = createRecord(i); } return listGridRecords; } private ListGridRecord createRecord(int i) { ListGridRecord listGridRecord = new ListGridRecord(); listGridRecord.setAttribute("F1", new Date()); listGridRecord.setAttribute("F2", new Date()); listGridRecord.setAttribute("F3", new Date()); return listGridRecord; }
Comment