Make filter show by default

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Clintre
    Junior Member
    • Sep 2016
    • 29

    Make filter show by default

    What do I need to do, to have a filter show by default as opposed to having users select "Add Field"? This way I can have fields like "Status" show all the time as it is used. Many of our users are not technical and we have high turn over so training can be a pain.
    Last edited by Clintre; 09-23-2016, 02:31 PM.
  • yuri
    Member
    • Mar 2014
    • 8474

    #2
    Not sure what exactly do you mean. Maybe this would help http://forum.espocrm.com/forum/devel...-for-drop-down ?
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • Clintre
      Junior Member
      • Sep 2016
      • 29

      #3
      So here is an example...

      Right now if a user wants to have a filter on the Cases list they click the "Add Field" and choose the filter/field they want to filter by. I would like to see where we as administrators could set that by default, so if I want the "Status" filter to show all the time, we can do that.

      Comment

      • yuri
        Member
        • Mar 2014
        • 8474

        #4
        client/src/views/list.js

        See getSearchDefaultData
        It looks to metadata.

        You will need to define in clientDefs for your entity type

        PHP Code:
        "defaultFilterData": {
          "advanced": {
             "status": {
                "type": "in",
                "value": ["Default", "Status", "Values"]
             }
          }
        } 
        
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • Vincent
          Senior Member
          • May 2017
          • 176

          #5
          hi, i have added below code into to the clientDefs json file of the entity, but no default filter show in the list view of the entity. Is there anything i have done wrongly?

          "defaultFilterData": {
          "advanced": {
          "jobStatus": {
          "type": "in",
          "value": ["Active", "Inactive"]
          }
          }
          }

          the field of default filter i want to show is jobStatus (an enum field) and the value are "Active" & "Inactive"

          Thanks.

          Comment

          • tanya
            Senior Member
            • Jun 2014
            • 4308

            #6
            Hello
            It works, until you modify search data manually (or reset it).
            Hello, we have getSelectFilters function to preset search values in link field, Same way how to preset search values in list view? Please help, Thanks.

            Comment

            • Vincent
              Senior Member
              • May 2017
              • 176

              #7
              Thank you.

              Comment

              Working...