1. SmartClient Version: v9.0p_2013-10-17/LGPL Development Only (built 2013-10-17) - latest patched 4.0p
2. Firefox 3.6.17
3.
4.
5.
6. sample code
Hi,
PickTreeItem used in grid's criteria row does not follow column widths - means width of criteria editor is out of sync with grid column width.
The first screen shot shows initial situation, and the second one the situation after column resize.
MichalG
2. Firefox 3.6.17
3.
4.
5.
6. sample code
Hi,
PickTreeItem used in grid's criteria row does not follow column widths - means width of criteria editor is out of sync with grid column width.
The first screen shot shows initial situation, and the second one the situation after column resize.
Code:
package pl.com.tech4.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.user.client.DOM; import com.smartgwt.client.data.DataSource; import com.smartgwt.client.data.DataSourceField; import com.smartgwt.client.data.fields.DataSourceTextField; import com.smartgwt.client.util.SC; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.PickTreeItem; import com.smartgwt.client.widgets.form.fields.PickerIcon; import com.smartgwt.client.widgets.form.fields.events.FormItemClickHandler; import com.smartgwt.client.widgets.form.fields.events.FormItemIconClickEvent; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.layout.VLayout; public class MainEntryPoint implements EntryPoint { public void onModuleLoad() { DOM.getElementById("loadingPicture").removeFromParent(); layout(); SC.showConsole(); } private void layout() { DataSource ds = new DataSource(); DataSourceField fieldId = new DataSourceField(); fieldId.setName("id"); fieldId.setPrimaryKey(true); DataSourceTextField field1 = new DataSourceTextField(); field1.setName("field1"); DataSourceField fieldParentId = new DataSourceField(); fieldParentId.setName("parentId"); fieldParentId.setForeignKey("id"); DataSourceTextField field2 = new DataSourceTextField(); field2.setName("field2"); ds.setFields(fieldId, field1, fieldParentId, field2); PickTreeItem parentIdItem = new PickTreeItem("parentId"); parentIdItem.setEmptyDisplayValue(""); PickerIcon clearPickerIcon = new PickerIcon(PickerIcon.CLEAR); clearPickerIcon.addFormItemClickHandler(new FormItemClickHandler() { public void onFormItemClick(FormItemIconClickEvent event) { event.getItem().clearValue(); } }); parentIdItem.setIcons(clearPickerIcon); ListGrid lg = new ListGrid(); lg.setShowFilterEditor(true); lg.setWidth(500); lg.setUseAllDataSourceFields(true); ListGridField lgf1 = new ListGridField("field1"); lgf1.setWidth(200); ListGridField lgf = new ListGridField("parentId"); lgf.setFilterEditorProperties(parentIdItem); ListGridField lgf2 = new ListGridField("field2"); lgf2.setWidth(400); lg.setFields(lgf1, lgf, lgf2); lg.setDataSource(ds); lg.draw(); } }
Comment