Announcement

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

    12.1p ListGrid filterRow SelectItem loads too much data

    Hi Isomorphic,

    please see this modified sample (v12.1p_2023-01-24).
    By default, the filterRow-SelectItem seems to load all data. I'm not sure this has been always the case, but I find it a bit weird.
    Also, setting dataFetchMode: "paged" does not seem to be able to affect this.
    In the response I always get startRow:0, endRow:3959, meaning all records have been loaded.

    Is the default behavior and the behavior with dataFetchMode: "paged" here really correct?

    Thank you & Best regards
    Blama

    Code:
    isc.ListGrid.create({
        ID: "dsListGrid",
        width: "100%",
        height: "100%",
        autoFetchData: true,
        dataSource: "supplyItem",
        showFilterEditor: true,
        fields: [
            { name: "itemID", width: 60 },
            {
                name: "itemName",
                filterEditorType: "SelectItem",
                filterEditorProperties: {
                    pickListHeight: 1000,
                    pickListCriteria: {
                        _constructor: "AdvancedCriteria",
                        operator: "and",
                        criteria: [{
                            fieldName: "itemID",
                            operator: "lessThan",
                            value: 10000
                        }]
                    },
                    optionDataSource: "supplyItem",
                    // multiple: true,
                    defaultValue: null,
                    dataFetchMode: "paged"
                }
            },
            { name: "SKU" },
            { name: "category" },
            { name: "units" }
        ]
    });

    #2
    Hi Isomorphic,

    sorry, please disregard the 2nd part of the post.
    With
    Code:
    pickListProperties: { dataFetchMode: "paged" }
    I can get the SelectItem to use paging.

    The remaining question is if the default of fetching all rows is on purpose.

    Best regards
    Blama

    Comment


      #3
      Upon further investigation, the reason paging is not active for your pickList is because it's incompatible with SelectItem.allowEmptyValue, which by default is true when a SelectItem appears in a FilterEditor. We're looking into making some improvements to allow paging in that case, but for now the workaround is to use separate "special values" in your SelectItem, like this

      Code:
              {
                  name: "itemName",
                  filterEditorType: "SelectItem",
                  filterEditorProperties: {
                      pickListHeight: 1000,
                      pickListCriteria: {
                          _constructor: "AdvancedCriteria",
                          operator: "and",
                          criteria: [{
                              fieldName: "itemID",
                              operator: "lessThan",
                              value: 10000
                          }]
                      },
                      // show empty value separately
                      allowEmptyValue: false,
                      separateSpecialValues: true,
                      specialValues: [""],
      
                      optionDataSource: "supplyItem",
                      // multiple: true,
                      defaultValue: null,
                      dataFetchMode: "paged"
                  }
              },
      Note that the reason allowEmptyValue is true by default in the FilterEditor is so you can clear the filter for the field.

      Comment


        #4
        Hi Isomorphic,

        that explanation makes sense. I agree that a better default, that does not load all rows, would make sense here.

        If that change is difficult, this might be a quick win:
        It seems that allowEmptyValue is also true by default (and therefore paging disabled) when the SelectItem is multiple: true.
        I don't think this is necessary, as in a multiple: true SelectItem one can always select no entry. So setting multiple: true should not result in an automatic allowEmptyValue: true, like it does now.

        What do you think?

        Thank you & Best regards
        Blama

        Comment


          #5
          We agree. Thanks for the suggestion. We will be updating this shortly.

          Comment

          Working...
          X