Announcement

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

    customize top operators in filter builder

    I'm trying to remove the "match none" top operator from my filter builder. I saw this forum:

    http://forums.smartclient.com/showthread.php?t=11548

    and followed it's advice, using setTypeOperator(null, OperatorId[]) but all that seems to happen is that none of my fields show up in the filters and I still see the match none.

    Here's the code I'm using. Any suggestions

    Code:
    final FilterBuilder filterBuilder = new FilterBuilder();
    filterBuilder.setTopOperatorAppearance(topOperatorAppearance);
    filterBuilder.setDataSource(new com.collegenet.smartgwt.client.data.DataSource(){{
      setClientOnly(true);
      OperatorId[] ops = {OperatorId.AND, OperatorId.OR};
      setTypeOperators(null, ops);
      for(final Record attr : attrs){
        addField(new DataSourceTextField(field){{
          Record[] options = attr.getAttributeAsRecordArray("options");
          if(options.length > 0){
            setValueMap(Admit.createOptionMap(options));
            setValidOperators(OperatorId.EQUALS, OperatorId.IS_NULL, OperatorId.NOT_NULL );
          }else {	
            setValidOperators(OperatorId.EQUALS, OperatorId.ICONTAINS, OperatorId.ISTARTS_WITH, OperatorId.IENDS_WITH, OperatorId.NOT_EQUAL, OperatorId.INOT_CONTAINS, OperatorId.INOT_STARTS_WITH, OperatorId.INOT_ENDS_WITH, OperatorId.IS_NULL, OperatorId.NOT_NULL );
         } 
       }});
      }
    }});
    filterBuilder.setFieldPickerProperties(new ComboBoxItem(){{
    	setTextMatchStyle(TextMatchStyle.SUBSTRING);	}});
    Last edited by saltwater; 12 Sep 2012, 09:24.
Working...
X