Announcement

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

    Retrieve From and To date in FilterEditor

    Hi, is it possible to retrieve From and To dates when using FilterEditor in listgrid?

    Thank you for your help.

    #2
    Yes - use ListGrid.getFilterEditorCriteria().

    Comment


      #3
      Hello again Isomorphic, I tried using ListGrid.getFilterEditorCriteria().getAttributeAsDate("listgrid_field_name") but i did not get anything. What I would like to retrieve is the two dates, which are for example in the picture, Mar 12 and Mar 27.

      Any assistance would be greatly appreciated.

      Comment


        #4
        You should find that dataSource.getFieldCriterion() returns an object you can work with.

        Code:
        grid.getDataSource().getFieldCriterion(grid.getFilterEditorCriteria(), "listgrid_field_name");
        We may consider adding a parameter to ListGrid.getFilterEditorCriteria(), or a new API, so you can get the crit for just one filterEditor field more directly.
        Last edited by Isomorphic; 15 Mar 2020, 02:57.

        Comment


          #5
          We've added a helper API, ListGrid.getFilterEditorCriterion(fieldName), which will return the criteria for a single field, by calling dataSource.getFieldCriterion() as noted previously - the return value can be a single restriction, or an advancedCriteria containing multiple sub-criteria.

          You can try that out in builds of 12.x dated March 17 and later.

          Comment

          Working...
          X