Hi Isomorphic,
please see this 5.1p BuiltInDS based testcase (using v10.1p_2016-01-20/PowerEdition Deployment):
BuiltInDS.java:
If you click e.g. "Unit Cost", after sorting the ListGrid will have a horizontal scrollbar. This is also true for other columns where the header-width is larger than the data-width (e.g. "Next Shipment").
I think the columnwidth-sizing should be in a way, that the column can accommodate the sort arrow and possible sort indicators.
This has a low priority for me.
Best regards
Blama
please see this 5.1p BuiltInDS based testcase (using v10.1p_2016-01-20/PowerEdition Deployment):
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.DataSource; import com.smartgwt.client.types.AutoFitWidthApproach; 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 a field which header-width larger than data-width causes horizontal scroll bar"); w.setShowMinimizeButton(false); w.setIsModal(true); w.setShowModalMask(true); w.centerInPage(); ListGrid lg = new ListGrid(DataSource.get("supplyItem")); lg.setWidth100(); lg.setHeight(600); lg.setCanSort(true); lg.setAutoFitFieldWidths(true); lg.setAutoFitWidthApproach(AutoFitWidthApproach.BOTH); w.addItem(lg); w.show(); lg.fetchData(new AdvancedCriteria("itemName", OperatorId.ISTARTS_WITH, "Acc")); } }[B][/B]
If you click e.g. "Unit Cost", after sorting the ListGrid will have a horizontal scrollbar. This is also true for other columns where the header-width is larger than the data-width (e.g. "Next Shipment").
I think the columnwidth-sizing should be in a way, that the column can accommodate the sort arrow and possible sort indicators.
This has a low priority for me.
Best regards
Blama
Comment