Announcement

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

    ListGrid FilterEditor for a column should allow only specific range of values.

    Hi Support Team,

    On a
    listGrid.setShowFilterEditor(true);

    How can I customized the editor for a specific column that should allow only entering a specific range of values?

    Thanks

    #2
    Hi jessgarcia,

    ListGridField + setEditorProperties, the parameter is a FormItem-subclass with a validator.
    Even better, if this is a client/server setting: Define a validator on the field in your .ds.xml-file for the DataSource the ListGrid is using.

    Best regards
    Blama

    Comment


      #3
      Hello,

      Actually that is not the answer I need. I need a validator for "FilterEditor" of the cell, like a mask for the Filter.

      E.g.
      On a grid I have a column, that shows integers, I want that user can only type numbers in the Column Filter of the grid.
      Or a column that only shows IP's, the user should only be allow to type [0-9a-f.] chars in the column filter of the ListGrid.

      That way user should not attempt to filter by values that do not even exists.

      Thanks,
      Jessica
      Last edited by jessgarcia; 11 May 2017, 01:14.

      Comment


        #4
        Originally posted by jessgarcia View Post
        Hello,

        I need a validator for "FilterEditor"
        So you need to use ListGridField.setFilterEditorProperties.
        HTH
        MichalG

        Comment


          #5
          Sorry yes, I overread the setShowFilterEditor(true). So use the API michalg gave and a FormItem with a validator (or a SelectItem, if you know the list of values upfront).
          If the validator approach does not work, try a setEditorValueParser() to null out unwanted values.

          Comment


            #6
            For IPs, you could try a TextItem with setMask()

            Comment


              #7
              Hi MichalG and Blama,

              Thanks for your tips.
              I resolve it with listGridField.setFilterEditorProperties(TextItem.setKeyPressFilter("regex"))

              regards,
              Jessica

              Comment

              Working...
              X