Announcement

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

    [bug] PresetDateRangeItem filter select problem

    SmartClient Version: v9.0p_2013-08-20/EVAL Development Only

    modify the #dateRangeFilterPresets sample like this:

    Code:
    isc.DataSource.create({
        ID: "presetDateRangeDS",
        clientOnly: true,
        fields: [
            { name: "customerID" },
            { name: "customerName" },
            { name: "orderID" },
            { name: "orderDate", type: "date" },
            { name: "orderDescription" },
            { name: "orderQty" }
        ],
        testData: presetDateRangeData
    });
    
    
    isc.ListGrid.create({
        ID: "grid1",
        top: 50, width: 590, height: 300, left: 10,
        dataSource: presetDateRangeDS,
        autoFetchData: true,
        useAllDataSourceFields: true,
        showFilterEditor: true,
        canGroupBy: true,
        fields: [
            { name: "orderDate", filterEditorType: "RecentDateRangeItem" }
        ]
    });
    then execute this code in the developer console (I need to dynamically modify the options):

    Code:
    isc.defineClass("RecentDateRangeItem", "PresetDateRangeItem").addProperties({
        options: {
                    "aday" :
                { fieldName: "orderDate", operator: "betweenInclusive",
                    start: new Date(2013,8,11), end:new Date(2013,8,12)
                },
            "other" :
                { fieldName: "orderDate", operator: "betweenInclusive",
                    start: new Date(2013,8,13), end:new Date(2013,8,14)
                }
        }
    });
    
    grid1.setShowFilterEditor(false)
    grid1.setShowFilterEditor(true)
    this dynamic update of the filter is working (btw, there's a better way than hiding/showing the filter?).

    but the problem is when you select the second option ('other') and then click 'filter'.
    The grid is filtered correctly, but the first option ('aday') is selected.

    Also note that the selection doesn't change with up/down arrows when focused.
    This bug is also present in the original (unmodified) #dateRangeFilterPresets sample, grid1 and grid2.

    #2
    A show/hideFilterEditor cycle wouldn't be a valid way to pick up a newly defined filterEditorType. Try setFields(). If you still see an issue, please show the modified code.

    Comment


      #3
      thanks, I'll try it.

      But please note the other issue, present in the original (unmodified) #dateRangeFilterPresets sample:
      the filter selection of that field doesn't change with up/down arrows, when focused.

      Comment


        #4
        We've made changes to address this - please retest with a nightly build dated September 17 or later

        Comment


          #5
          Originally posted by Isomorphic View Post
          A show/hideFilterEditor cycle wouldn't be a valid way to pick up a newly defined filterEditorType. Try setFields().
          setFields doesn't seem to update the filter.
          Tried this:
          Code:
          isc.DataSource.create({
              ID: "presetDateRangeDS",
              clientOnly: true,
              fields: [
                  { name: "customerID" },
                  { name: "customerName" },
                  { name: "orderID" },
                  { name: "orderDate", type: "date" },
                  { name: "orderDescription" },
                  { name: "orderQty" }
              ],
              testData: presetDateRangeData
          });
          
          var fields =  [
                  { name: "orderDate", filterEditorType: "RecentDateRangeItem" }
              ];
          isc.ListGrid.create({
              ID: "grid1",
              top: 50, width: 590, height: 300, left: 10,
              dataSource: presetDateRangeDS,
              autoFetchData: true,
              useAllDataSourceFields: true,
              showFilterEditor: true,
              canGroupBy: true,
              defaultFields:fields
          });
          then executed this:
          Code:
          isc.defineClass("RecentDateRangeItem", "PresetDateRangeItem").addProperties({
              options: {
                          "aday" :
                      { fieldName: "orderDate", operator: "betweenInclusive",
                          start: new Date(2013,8,11), end:new Date(2013,8,12)
                      },
                  "other" :
                      { fieldName: "orderDate", operator: "betweenInclusive",
                          start: new Date(2013,8,13), end:new Date(2013,8,14)
                      }
              }
          });
          
          grid1.setFields([
                  { name: "orderDate", filterEditorType: "RecentDateRangeItem" }
              ]);
          and the filter has the previous 4 options.
          If I execute:
          Code:
          grid1.setFields([]);
          grid1.setFields([
                  { name: "orderDate", filterEditorType: "RecentDateRangeItem" }
              ]);
          then the filterEditor is updated.
          But the problem of the first option selected when filtering with the second option remains.

          I'll retry with tomorrow's build.

          Comment


            #6
            SmartClient Version: v9.0p_2013-09-17/EVAL Development Only
            tested on:
            Chrome 29.0.1547.65 on Mac OSX
            Firefox 24.0

            actually the problem with the keyboard navigation is solved.

            but the original problem remains, I've got the same behaviour with the sample of post #1 and also with the code of post #5.

            Comment


              #7
              It looks like you're trying to use defaultFields in combination with setFields. defaultFields is for custom components that need to define automatically used fields. You should be using grid.fields at initialization, then setFields() later.

              Comment


                #8
                ok, but using fields instead of defaultFields results in the same behaviour, both samples.

                Comment


                  #9
                  An issue with criteria detection by object comparison has been fixed in this area - please retest with a nightly build dated September 19 or later... Your original code will most likely work as-is.

                  Comment


                    #10
                    the samples are working, thanks

                    Comment

                    Working...
                    X