Hi Isomorphic,
please see this v10.1p_2015-12-18/PowerEdition BuiltInDS-based testcase:
BuiltInDS.java:
supplyItem.ds.xml:
Thank you & Best regards
Blama
EDIT: Tested in GC47 Compiled and FF26 Dev Mode
please see this v10.1p_2015-12-18/PowerEdition BuiltInDS-based testcase:
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.AdvancedCriteria;
import com.smartgwt.client.data.Criterion;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.types.OperatorId;
import com.smartgwt.client.util.Page;
import com.smartgwt.client.util.PageKeyHandler;
import com.smartgwt.client.util.SC;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.Window;
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.layout.VLayout;
public class BuiltInDS implements EntryPoint {
private VLayout mainLayout;
private IButton recreateBtn;
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();
}
});
mainLayout = new VLayout(20);
mainLayout.setWidth100();
mainLayout.setHeight100();
recreateBtn = new IButton("Recreate");
recreateBtn.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
recreate();
}
});
mainLayout.addMember(recreateBtn);
recreate();
mainLayout.draw();
}
private void recreate() {
Window w = new Window();
w.setWidth("95%");
w.setHeight("95%");
w.setMembersMargin(0);
w.setModalMaskOpacity(70);
w.setTitle("Sorting by other fields when grouping");
w.setShowMinimizeButton(false);
w.setIsModal(true);
w.setShowModalMask(true);
w.centerInPage();
ListGrid supplyItem = new ListGrid(DataSource.get("supplyItem"));
supplyItem.setCanGroupBy(true);
supplyItem.setCanSort(true);
supplyItem.setInitialCriteria(new AdvancedCriteria(new Criterion("itemName", OperatorId.STARTS_WITH, "Acc")));
supplyItem.setAutoFetchData(true);
w.addItem(supplyItem);
w.show();
}
}
Code:
Please add this to field "itemName" in supplyItem.ds.xml: [B]sortByField="description"[/B]
- After startup, click "Item"-Header (1st column) twice to sort by the itemName-field (which uses the description data) descending.
- This is working as expected.
- Now right-click "Category"-header to group by it.
- See that now on click of the "Item"-Header, the itemName-value is used to sort instead of the expected description-value.
Thank you & Best regards
Blama
EDIT: Tested in GC47 Compiled and FF26 Dev Mode
Comment