The leftmost field in my filterbuilder row seems to be set by default to 100px, where as the rest of the fields in the filterbuilder row are set to 150px. I believe the left most field is the field picker. I've set the field picker properites to a 150 width, but this just seems to be ignored. I've seen a few questions about filter builder field widths on the forum, often with people posting more recently that the hacks no longer work.
Is there some reason setting width on the field picker properties fail? Is there some other way to force the left field to be the same size as the other fields?
I've included some cleaned up code showing the relevent section.
Is there some reason setting width on the field picker properties fail? Is there some other way to force the left field to be the same size as the other fields?
I've included some cleaned up code showing the relevent section.
Code:
private FilterBuilder createFilterBuilder(final Record[] attrs) { final FilterBuilder filterBuilder = new FilterBuilder(); filterBuilder.setTopOperatorAppearance(TopOperatorAppearance.RADIO); filterBuilder.setDataSource(new DataSource(){{ setClientOnly(true); for(final Record attr : attrs){ String name = attr.getAttribute("name"); String label = attr.getAttribute("label"); String fieldName = getFieldName(name); addField(new DataSourceDateTimeField(fieldName, label){{ setValidOperators(OperatorId.GREATER_THAN, OperatorId.LESS_THAN, OperatorId.IS_NULL, OperatorId.NOT_NULL); }}); } }}); filterBuilder.setFieldPickerProperties(new ComboBoxItem(){{ setTextMatchStyle(TextMatchStyle.SUBSTRING); setAddUnknownValues(false); }}); filterBuilder.setHeight100(); return filterBuilder; }
Comment