Hi Isomorphic,
please see this minimal testcase on how sort on datefields (or even more?) is broken:
Error 1:
1) Load page, dates sorted, sort icon shown
2) Change dates, sorting still correct, sort icon shown
3) Click header to sort (sort direction changes, icon does NOT)
4) Change dates, no more sorting, sort icon gone
Error 2:
1) Un-comment setCanSort(false);
2) Load page, dates sorted, no icon shown!
3) Change dates, sorting still correct, no sort icon shown!
Error 3:
1) Un-comment setCanSort(false); and setFields(datumLGF);
2) Load page, dates sorted, no icon shown!
3) Change dates, no sorting
Java:
.ds.xml
SQL (Oracle)
Best regards,
Blama
please see this minimal testcase on how sort on datefields (or even more?) is broken:
Error 1:
1) Load page, dates sorted, sort icon shown
2) Change dates, sorting still correct, sort icon shown
3) Click header to sort (sort direction changes, icon does NOT)
4) Change dates, no more sorting, sort icon gone
Error 2:
1) Un-comment setCanSort(false);
2) Load page, dates sorted, no icon shown!
3) Change dates, sorting still correct, no sort icon shown!
Error 3:
1) Un-comment setCanSort(false); and setFields(datumLGF);
2) Load page, dates sorted, no icon shown!
3) Change dates, no sorting
Java:
Code:
package com.smartgwt.sample.client; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.SortDirection; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; import com.google.gwt.core.client.EntryPoint; public class Testcase implements EntryPoint { @Override public void onModuleLoad() { VLayout vL = new VLayout() { { setWidth100(); setHeight100(); final DataSource testDS = DataSource.get("T_TEST3"); final ListGrid testLG = new ListGrid() { { setDataSource(testDS); // setSort(new SortSpecifier[] { new SortSpecifier("DATUM", SortDirection.ASCENDING) }); setSortField("DATUM"); // setCanSort(false); setCanEdit(true); ListGridField datumLGF = new ListGridField("DATUM"); // setFields(datumLGF); fetchData(); } }; addMember(testLG); } }; vL.draw(); } }
Code:
<DataSource schema="testcase" dbName="Oracle" tableName="T_TEST" ID="T_TEST3" dataSourceVersion="1" serverType="sql" > <fields> <field primaryKey="true" hidden="true" name="ID" type="sequence"></field> <field name="DATUM" type="date"></field> </fields> </DataSource>
Code:
DROP TABLE t_test CASCADE CONSTRAINTS ; DROP SEQUENCE T_TEST_ID ; CREATE TABLE t_test ( id INTEGER NOT NULL, datum date ) ; CREATE SEQUENCE T_TEST_ID NOCACHE ORDER ; CREATE OR REPLACE TRIGGER t_test_BI BEFORE INSERT ON t_test FOR EACH ROW WHEN(NEW.id IS NULL) BEGIN SELECT T_TEST_ID.NEXTVAL INTO :NEW.id FROM DUAL; END; / insert into t_test (datum) values (sysdate-3); insert into t_test (datum) values (sysdate-2); insert into t_test (datum) values (sysdate-1); insert into t_test (datum) values (sysdate); commit ;
Blama
Comment