Hi Isomorphic,
please see this code (BuiltInDS-based, v9.1p_2014-07-24, FF26 Dev mode).
BuiltInDS.java
animals.ds.xml
Steps to reproduce:
In the end, the ListGrid is still sorted correctly, but this must have happened on the client side.
This seems to happen only in grouped ListGrids.
Best regards,
Blama
please see this code (BuiltInDS-based, v9.1p_2014-07-24, FF26 Dev mode).
BuiltInDS.java
Code:
package com.smartgwt.sample.client; import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.core.KeyIdentifier; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.SortSpecifier; import com.smartgwt.client.types.SortDirection; import com.smartgwt.client.util.PageKeyHandler; import com.smartgwt.client.util.Page; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; /** * Entry point classes define <code>onModuleLoad()</code>. */ public class BuiltInDS implements EntryPoint { private ListGrid boundList; private IButton btn; public void onModuleLoad() { KeyIdentifier debugKey = new KeyIdentifier(); debugKey.setCtrlKey(true); debugKey.setKeyName("D"); Page.registerKey(debugKey, new PageKeyHandler() { public void execute(String keyName) { SC.showConsole(); } }); boundList = new ListGrid(DataSource.get("animals")); boundList.setWidth(1200); boundList.setHeight(600); boundList.setCanMultiSort(true); boundList.setCanSort(true); boundList.setShowFilterEditor(true); boundList.setAutoFetchData(false); ListGridField commonName = new ListGridField("commonName"); ListGridField scientificName = new ListGridField("scientificName"); ListGridField lifeSpan = new ListGridField("lifeSpan"); lifeSpan.setTitle("Our title"); lifeSpan.setSortByDisplayField(true); // ListGridField status = new ListGridField("status"); ListGridField diet = new ListGridField("diet"); ListGridField information = new ListGridField("information"); boundList.setFields(commonName, scientificName, lifeSpan, diet, information); boundList.setSort(new SortSpecifier("lifeSpan", SortDirection.ASCENDING)); boundList.fetchData(); btn = new IButton("invalidateCache()"); btn.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { boundList.invalidateCache(); } }); VLayout vLayout = new VLayout(10); vLayout.setMembers(boundList, btn); vLayout.draw(); } }
Code:
<DataSource ID="animals" serverType="sql" tableName="animals" testFileName="animals.data.xml" > <fields> <field name="commonName" title="Animal" type="text"/> <field name="scientificName" title="Scientific Name" type="text" primaryKey="true" required="true"/> <field name="lifeSpan" title="LIFESPAN BUT WE SHOW STATUS" displayField="status" type="integer"/> <field name="status" title="Endangered Status" type="text"> <valueMap> <value>Threatened</value> <value>Endangered</value> <value>Not Endangered</value> <value>Not currently listed</value> <value>May become threatened</value> <value>Protected</value> </valueMap> </field> <field name="diet" title="Diet" type="text"/> <field name="information" title="Interesting Facts" type="text" length="1000"/> <field name="picture" title="Picture" type="image" detail="true" imageURLPrefix="/isomorphic/system/reference/inlineExamples/tiles/images/"/> </fields> </DataSource>
- Load testcase
- Click "Scentific Name" to sort by that column
- (No DS Request is issued, client side sort)
- Click "Invalidate cache". A DS Request is issued, sorting by "Scentific Name")
- Group by "Diet"
- (No DS Request is issued, client side grouping)
- Click "Animal" to sort by that column
- (No DS Request is issued, client side sort)
- Click "Invalidate cache". A DS Request is issued, sorting by "Scentific Name")
In the end, the ListGrid is still sorted correctly, but this must have happened on the client side.
This seems to happen only in grouped ListGrids.
Best regards,
Blama
Comment