No announcement yet.

Filter grid with row menu button

  • Filter
  • Time
  • Show
Clear All
new posts

  • Filter grid with row menu button


    I have a grid that I want to filter using a row menu button (based on a value in that row).
    The column I want to filter on has too many different values to define a normal grid filter for it.
    I tried the following:
    1. Filter the grid itself through behaviours, NAB doesn't allow me to select the current grid for filtering. I don't want t make a copy of this grid, because in that case I have to maintain both.
    2. Define a grid filter, make it hidden through app vars and set the filter to a value with a ow menu button RPG call with SetValue. This doesn't work.
    Do you have a solution for this use case?

    Kind regards,

  • #2
    Just so I am clear, you want to filter down the results of a grid by clicking a row menu button against a row attached to the same grid. This is an unusual user experience.

    It is hard to come up with a definitive suggestion without understanding the data. Depending on your data/SQL, the following could work:
    • Use vvIn_virtual(s) within your data source as a means to filter down your data.
    • Define your app variables within your application
      • These app variables will be used to serve as the replacement values for your vvIn_virtual statement(s)
    • Create an app variable to your list "reloadList". Link this app variable to the reload property on your grid
    • Upon clicking your row menu button
      • Populate your app variables as needed to replace the vvIn_virtual statement(s) in your data source
      • Set your "reloadList" app variable to "true"


    • #3
      I tried your suggestion but I got stuck at the first step. I added
      PHP Code:
      and rmsnr vvin_virtual('serialNumber'null'char'15null'true'
      to the WHERE clause. This results in the error (reported that earlier):
      PHP Code:
      SQL0206 Column or globale variabele CHAR not found
      What I don't understand is how NOT to filter initially using the vvIn_virtual in my datasource.

      Let me explain the use case:
      The user is presented with a list of repairs sorted by repair id (date)
      Sometimes this specific product (serial number) was repaired before
      In that case I want to allow to filter down the list only for that specific serial number so the repair history can be found immediately.

      I would like to populate the search field or a grid filter from a row button.

      Any suggestions?

      Kind regards,


      • #4
        OK, I just tested something similar on our system and the following should work.

        Change your SQL to something similar:
        select x,y,z from myFile
          where myField = 123 and vvIn_virtual('serialNumber','1=1','char',40,null,'false')
        In your application, create the serialNumber app variable and the reloadList app variable. Link the reloadList app variable to the reload property on your grid.

        When user clicks the menu/icon -> Set App Variables:
        • reloadList
          • Set to "true"
        • serialNumber
          • Set to "rmsnr = '{RMSNR}'


        • #5
          I know Sean gave you a fix however wanted to comment on your post:

          I would like to populate the search field or a grid filter from a row button.
          The next Valence 6.0 update will have the ability to set the values of widget filters and the grid global search field based on app variables;


          • #6
            Thanks Johnny,
            That will solve several issues for me.