Announcement

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

    appending static criteria to filterEditor criteria

    What is the recommended way to append a static criteria {field1: 'val1', field2: 'val2'} to filterEditor criteria the user entered when filtering in a ListGrid? The static criteria may contain fields not shown in the ListGrid.

    Tried ListGrid.setFilterEditorCriteria({field1: 'val1', field2: 'val2'}) but the appended criteria is not getting sent to the server.

    Thanks
    -pf

    #2
    Just setCriteria(). If the criteria is on a non-filtereEditor field, it will be automatically preserved as the user makes changes in the FilterEditor.

    Comment


      #3
      Tried ListGrid.setCriteria({field1: 'val1', field2: 'val2'}) but the appended criteria is still not getting sent to the server upon filtering.

      I am doing this just after the ListGrid is created but before it is added to the layout. Does that make a difference?

      -pf

      Comment


        #4
        Is this perhaps an older version? We were referring to behavior from 8.1.

        Comment


          #5
          I'm on 8.0

          Comment


            #6
            Actually the snapshot is:

            SmartClient_SC_SNAPSHOT-2011-10-25

            -pf

            Comment


              #7
              OK, can't tell what's specifically happening here without code, but one way to make it fail would be setCriteria(someCriteria) followed by an explicit call to fetchData() with no criteria.

              Also, there are a couple of subtle bugs in 8.0 with respect to handling all the complex interactions between the criteria entered in the filterEditor vs hand-specific criteria, so we'd recommend an upgrade to 8.1.x if you want this handle automatically.

              Another option is to add the criteria in DataSource.transformRequest().

              Comment

              Working...
              X