Announcement

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

    How to set FilterBuilder default field operator

    I have a FilterBuilder requirement to set the default field operator to "contains". After reviewing the documentation I set the "validOperators" in the data source to "contains" and "iContains" (see source code) but when the FilterBuilder form is rendered the default is set to "equals" which is not even in the list of valid operators (see screen shots). Using the example code below, I expected to have two operators and the default operator to be "contains". I have tried other approaches without success including overriding the "getFieldOperators" in the data source, setting "fieldPickerProperties" and "fieldPickerDefaults" in the FilterBuilder instance, and reviewing the SmartClient documentation looking for a way to specify the default operator. Any help or guidance is greatly appreciated.

    I tested on Linux using the following SmartClient and browser versions:

    SmartClient_v111p_2017-07-28_LGPL
    SmartClient_v111p_2017-08-07_LGPL
    Chromium 53.0.2785.143 (64-bit)
    FireFox 51.0.1 (64-bit)

    Below are my test code and screen shots.

    Thanks,
    Andy

    Code:
    var dsFilterBuilder = isc.RestDataSource.create({
         'ID': 'dsFilterBuilder'
        ,'dataFormat' : 'json'
        ,'fields': [
            {
                 'name': 'name1'
                ,'title': 'Name 1'
                ,'type': 'text'
                ,'validOperators': ['contains', 'iContains']
            }
        ]
    });
    
    isc.FilterBuilder.create({
         'ID': 'fb'
        ,'dataSource': dsFilterBuilder
    });
    Click image for larger version  Name:	smartclient-filter-builder-default-field-op-1.png Views:	1 Size:	5.9 KB ID:	248167

    Click image for larger version  Name:	smartclient-filter-builder-default-field-op-2.png Views:	1 Size:	10.0 KB ID:	248168
    Last edited by pab; 7 Aug 2017, 07:56.

    #2
    Your code is correct - the bug that caused the issue has been fixed for builds dated August 9 and later.

    Comment


      #3
      Last edited by pab; 27 Sep 2017, 05:57. Reason: Removed the post because it might still be an issue. More testing required.

      Comment

      Working...
      X