Announcement

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

    Filter editor values not set for select item filters

    Version: v11.0p_2017-02-11/PowerEdition Deployment (built 2017-02-11)

    Hi,

    I am saving the listgrid filter state and on loading the grid again i apply the filter state.
    Columns for which the filter is a text item, the filter values appear in the filter editor rowl.
    However, there are few columns for which i have set the filter to be a select item by using below code:

    SelectItem filterSelectItem = new SelectItem();
    filterSelectItem.setDisplayField(ClientConstants.MATERIAL_DS_MATERIAL_NAME);
    filterSelectItem.setValueField(ClientConstants.MATERIAL_DS_MATERIAL_NAME);
    filterSelectItem.setOptionDataSource(materialDs);
    filterSelectItem.setAutoFetchData(true);
    listgridfield.setFilterEditorType(filterSelectItem);

    While setting the filter criteria those filters which are dropdown are not getting populated with the filter value. How can i set the value in this case

    #2
    Try this one (only my gut feeling as I do it the same way):
    Code:
    SelectItem filterSelectItem = new SelectItem();
    filterSelectItem.setOptionDataSource(materialDs);
    filterSelectItem.setDisplayField(ClientConstants.MATERIAL_DS_MATERIAL_NAME);
    filterSelectItem.setValueField(ClientConstants.MATERIAL_DS_MATERIAL_NAME);
    listgridfield.setFilterEditorProperties(filterSelectItem);
    (changed order, setFilterEditorType -> setFilterEditorProperties).

    Best regards
    Blama

    Comment


      #3
      Hi Blama,
      Thanks for your quick response. But this not seem to be working.
      Anything else i can try?

      Comment


        #4
        The usual:
        The DS exsts?
        The fields you name exist in the DS?
        Datatypes on DS fields are correct?
        The DSRequest has a equals criteria for the field in question?

        Best regards
        Blama

        Comment


          #5
          You can see it's working here:
          Code:
          isc.ListGrid.create({
              ID: "countryList",
              width:500, height:300,
              dataSource: worldDS,
              fields:[
                  {name:"countryCode", title:"Code", width:50},
                  {name:"countryName", title:"Country"},
                  {name:"capital", title:"Capital"},
                  {name:"continent", title:"Continent"}
              ],
              autoFetchData: false,
              showFilterEditor: true
          });
          countryList.fetchData({ _constructor: "AdvancedCriteria", operator: "and",
                  criteria: [
                      { fieldName: "continent", operator: "equals", value: "Europe" }]});

          Comment


            #6
            Thanks Blama.

            listGridField.setFilterOperator(OperatorId.EQUALS);

            This worked for me.

            Comment

            Working...
            X