Announcement

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

    setFilterEditorCriteria(null) or setFilterEditorCriteria({}) does not re-enable any disabled filter editor fields when alwaysShowOperatorIcon is true

    Performing a setFilterEditorCriteria(null) or setFilterEditorCriteria({}) does not re-enable any disabled filter editor fields when alwaysShowOperatorIcon is set to true on a list grid.

    VERSION: v12.0p_2019-07-10/Pro.


    BROWSER: This behavior has been observed on all browsers/platforms i.e. Chrome,Firefox,IE11,Safari/Linux,Windows 7 Enterprise,Mac Mojave

    SCENARIO:
    In a ListGrid with showFilterEditor, allowFilterOperators and set to true and alwaysShowOperatorIcon set to false, the user can click an operator icon and select “is blank”. This action correctly disabled the filter’s text field. When the user performs a clear operation (setFilterEditorCriteria(null) or setFilterEditorCriteria({})), the operator icon disappears and the filter text field re-enables. This is correct behaviour.

    Now, if you set alwaysShowOperatorIcon to true and perform the same actions, the operator icon reverts back to default (contains), but the filter text field stays disabled. The user is then unable to type anything in the filter editor. Manually toggling the filter operator seems to re-enable the field.

    STEPS TO REPRODUCE:
    Navigate to the following Showcase example: https://www.smartclient.com/smartcli...OperatorFilter
    Replace the entire contents of inlineOperatorFilter.js with the following (only adding the alwaysShowOperatorIcon property):

    Code:
    isc.ListGrid.create({
        ID: "countryList",
        width:550, height:300, alternateRecordStyles:true,
        dataSource: worldDS,
        fields:[
            {name:"countryCode", width:60},
            {name:"countryName"},
            {name:"capital"},
            {name:"continent"},
            {name:"area"},
            {name:"population"}
        ],
        autoFetchData: true,
        showFilterEditor: true,
        allowFilterOperators: true,
        alwaysShowOperatorIcon: true,
        initialCriteria: { _constructor: "AdvancedCriteria", operator: "and",
            criteria: [
                { fieldName: "countryName", operator: "iNotContains", value: "i" },
                { fieldName: "capital", operator: "iNotStartsWith", value: "p" }
            ]
        }
    });
    Click on the "Try it" button to run the code

    All operators will be displayed:
    Click image for larger version

Name:	Screen Shot 2020-02-03 at 4.03.36 PM.png
Views:	59
Size:	53.0 KB
ID:	260965
    Using the header context menu (right click) on the Capital filter editor, select the “is Blank” filter. The “is blank” filter icon is applied and the filter editor text field is disabled as expected:
    Click image for larger version

Name:	Screen Shot 2020-02-03 at 4.04.16 PM.png
Views:	23
Size:	53.6 KB
ID:	260966

    Now, open your browser’s developer console. And type “countryList.setFilterEditorCriteria(null);” or countryList.setFilterEditorCriteria({});”. Notice that the filter editor operator icons properly revert back to the default icons, but the Capital filter editor text field stays disabled as if the operator was still “is blank”:

    Click image for larger version

Name:	Screen Shot 2020-02-03 at 4.04.56 PM.png
Views:	23
Size:	47.9 KB
ID:	260967
    The user is now unable to filter on the Capital column as the text box is disabled. Manually toggling the filter by right clicking and changing the filter operator on the column is the only way for the user to re-enable the text box.

    #2
    Thanks for the test case
    We've made a change which should take care of this issue. Please try the next nightly build dated Feb 7 or above

    Regards
    Isomorphic Software

    Comment

    Working...
    X