Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to widen field picker on filter builder

    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.

    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;
    }

    #2
    Hi Isomorphic,

    Do you have any recommendations to get the first field(filter picker?) on the filter builder to be wider? I've attached an image for what we're seeing.

    Thanks
    Attached Files

    Comment


      #3
      I've been playing with this a bit and I found an interesting look at this. Width in particular isn't obeyed, though height is.

      This code is for setAutoChildProperties, but at least part of it works on setFieldPickerProperties. The point is that the filterbuilder is selectively choosing which comboboxitem properties to obey.

      Code:
      final FilterBuilder filterBuilder = new FilterBuilder(){{
      	setAutoChildProperties("fieldPicker", new ComboBoxItem(){{
      		setTextMatchStyle(TextMatchStyle.SUBSTRING);
      		setAddUnknownValues(false);
      		this.setPickListWidth(150);
      		this.setWidth(150);
      		this.setHeight(40);
      	}});
      }};

      Comment


        #4
        Hi Isomorphic,

        Do you have any updates on this?

        Comment

        Working...
        X