0

clearing the Filter option in a column on closing a view

As you can see there is an applied filter to PROJECT in this screenshot.  Is there a way to reset all filters that might be applied when a view is closed.

In other words when I leave this search form any applied filters inside the view will be reset to 'none' so that next time I search the previous filter is not applied.

 

10 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    You can use the TAB element setting 'Trigger after hide' to clear the fields.

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

       I do not understand how that can work.  
      For example:  How will 'Text' := null clear the filter from the column Titled 'Project' in the view?

      • Ninox partner
      • RoSoft_Steven.1
      • 1 yr ago
      • Reported - view

      Oh, I didn't know you were using Ninext extensions....

      I can't answer your question, though.

      Maybe can...

      • Ninox developper
      • Jacques_TUR
      • 1 yr ago
      • Reported - view

      RoSoft_Steven If you work with Ninext, then you can try this code, which will systematically remove filters before the table is opened.
      Put the code behind one button or inside one formula :

      #{
      ui.openTableOld?null:ui.openTableOld=ui.openTable;
      ui.openTable = function(...arg) {
          ui.openTableOld(...arg);
          document.querySelectorAll('#exColumnFilter-close')?.forEach( button => button.click())
      }
      }#;
      
      
      • Alan_Cooke
      • 1 yr ago
      • Reported - view

       This works perfectly as you instruct above.  However in my scenario I have a text field that I use to input a search term.  The View has the following formula:

      let recs := (select 'PROJECT EQUIPMENT');
      if 'SEARCH MAKE' then
          let s := 'SEARCH MAKE';
          recs := recs[MAKE like s]
      end;
      recs

      Which shows the results of the search term.

      I have tried a number of way to incorporate your code in the above but am unable to get it to work. 

      Is there a way of combining my script and yours?

       

    • Fred
    • 1 yr ago
    • Reported - view

    That is interesting. If I'm not in Admin mode, the column filters do NOT get remembered when I click on another table. This happens with reference tables and views.

      • Alan_Cooke
      • 1 yr ago
      • Reported - view

       As Owner they are remembered which trips me up from time to time because I miss the 'funnel' off screen and I know there is missing information.

      • Fred
      • 1 yr ago
      • Reported - view

      I'm the owner of the DBs and they don't remember filters if I'm NOT in admin mode.

    • Mel_Charles
    • 1 yr ago
    • Reported - view

    Im on web version and db owner. Mine does this

    table A view 1 (filter say customers to show ARM) data limit applied

    switch to view 2, same table. customers shows all data.

    switch back to view 1 (filter is still remembered) and data limit applied  

    Same applies if i set the above and jump to a different table and back.

    whether in admin mode or not!

    Sometimes this is an issue cos you can set a view filter then have to change view table etc then later come back in the day.

     

    Yep i hear you say - but surley you can see the piped filter symbol and yes i agree

    trouble on one of my tables i have something like 14 views to shoe all new jobs, jobs on proof etc

    and these have filters set be design ! 🤣

    • Fred
    • 1 yr ago
    • Reported - view

    Yes, in Table view the filters stick, but not in view element or reference table which is what Alan was showing.

Content aside

  • 1 yr agoLast active
  • 10Replies
  • 153Views
  • 5 Following