0

Custom Filters

  • updated 3 yrs ago

Introduction

An additional customization feature that you can apply to the Starter App session grid is customized filtering buttons based on any of the meta data in the view. These "Hotkeys" can be useful for giving your users the most common filtering settings in one click. You can configure each button to apply a single filter or a set of filters to the listed sessions. You can apply the filter to visible or hidden columns as well as to such standard columns as "Status" or application-specific meta-data columns.

 

Configure Filtering Buttons

The following steps walk you through adding filters.

Step 1: Add a Button to the main_ui Logicnet in the Starter

Keeping the object the same as for other buttons (the default is "action"), provide a unique value to the button that describes the filter; for example, filter_reset or filter_data_load.

 

Step 2: Add Each Filter Value to the Router in the main_panel_process Logicnet and Route to a Process Node

The logicnet called main_panel_process usually controls the new/resume/delete session controls, and you can expand it to deal with the filtering. First, add the values to the possible outputs of the router. Then add a process node to each new route, linking back to the final node in keeping with other process flows in the logicnet (see image below).

TIP: Your users will most likely want a RESET button to undo any filtering hotkeys so don't forget that route and filter option.

 

Step 3: Add set_data_object Parts to Each Filter Option

Each process node should contain a set_data_object part that specifies the filter condition. This should be in the following format:

Path: [name of filter object]

Value: [column variable from grid] = "[filtered value]" (this will be added to a SQL SELECT statement within the grid)

 

For example, the following set_data_object part filters to only those records that show a status of "Completed":

filterStatus

status = "Completed"

 

The filtering term can apply across multiple columns, such as col1 = "Red" and col2 = "In Progress". It can also use SQL SELECT terms, including LIKE, IN, BETWEEN [A] and [B], as well as the usual mathematical operators.

 
For the RESET filter, this is done exactly the same way, except the process node contains a delete_object part that removes the filter object from the context.

Step 4: Add the Filter to the Grid

The final step in the process is to add the filter to the grid part. This is located in the main_panel_ui logicnet in the sessions node if you are using the default Starter project. Add the filter name to the Additional Filters box.

 

Note that the dbgrid 3 part has many features and options for searching, sorting, and filtering records. The full list of options are detailed in the dbgrid3 part support article.

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 3 yrs agoLast active
  • 28Views
  • 2 Following

Home