RETURN TO BLOGS

Master DataTables Series: 2.3 Searching

by Jody Barney - Application Developer

Welcome to the multi-part video series that will teach you how to implement DataTables in your Claris FileMaker Pro solutions effectively. If you’re new to this series, we recommend starting from the introduction to maximize your learning experience. You can access the complete series here: Master DataTables with Claris FileMaker Pro.

In the previous post, we examined DOM elements. The settings that drive the searching, pagination, and other important customizations your users will utilize when interacting with the reports you build.

In this post, we will discuss the native searching feature in DataTables. Specifically, we will learn how to use and control the search (or filter) option in your DataTables report.

Controlling Search Appearance

As we will learn about all the DOM Elements in this series, there are two main approaches to controlling the appearance of an element in your report. We can toggle the search box on or off, affecting its presence when we preview the build.

Option 1: Modify the DOM Elements

We can control whether the search box appears on the report by modifying the values we set for DOM elements.

The default DOM arrangement is constructed like this:

lfrtip

If we want to prevent the user from being able to search on this report, we can remove the ‘f’ (filter):

lrtip

Option 2: Control the JS Function’s settings

We can also disable searching for specific reports. We can also disable searching for specific reports. Even if the DOM element enables filtering (example: lfrtip), we can toggle the search feature on or off in each report’s settings.

The syntax that appears in the DataTables settings would appear like this:

searching: true

or

searching: false

Granular Search Control

The native search capability is often a reason why DataTables is utilized in a solution. However, there are times when including the search feature is necessary, but excluding specific columns of data is needed. Fortunately, search behavior can also be controlled on a column-by-column basis.

The same approach we used to toggle the search feature on or off for the entire report can be utilized on individual columns in your report. By default, the DataTables Builder constructed each column in the report to be searched upon, searchable: true. By modifying this setting to searchable: false – we exclude that column’s data from being included in the user’s search.

Demo File

The demo file (see bottom of blog post to download) allows us to practice the various options for hiding or displaying the search feature and how we can modify column attributes to change search behavior.

In the video tutorial, I demonstrate practical search scenarios using the data in the demo file.
Multi-part searches are explained, where spaces can be used to filter data across multiple columns. DataTables uses a “subtractive method”, where consecutive searches narrow down the found set of records.

Using Search for Data Insights

It is important to know how the search feature works. Educating users on multi-part searches and other features can help them make the most of the search functionality.

Besides the obvious, searches can be performed to gain insights without creating complex relationships, scripts, or static reports. An example of this ad-hoc reporting approach is illustrated in the video. With proper training of the DataTables search feature, we can empower users to find answers to their questions.

What’s next?

The lessons in this series explore individual DOM elements in detail and how to customize and manipulate them even further.

In the next post, we cover pagination or the ‘p’ DOM element. We will learn how to control its visibility, placement, and styling options to enhance the navigation requirements of your report.

Join the Training Series Now

Subscribe to our YouTube channel to keep up with the video training series. Comment on the YouTube videos to interact with us and share your thoughts and questions. Also, don’t forget to join our mailing list for updates on new videos and additional resources.

Please enter your contact information to download the Demo file.

This field is for validation purposes and should be left unchanged.
DOWNLOAD

Leave a comment

Your email address will not be published. Required fields are marked *

Your email address will not be published. Required fields are marked *

Built with you in mind

Speak to one of our expert consultants about making sense of your data today. During
this free consultation, we'll address your questions, learn more about your business, and
make some immediate recommendations.

REQUEST A TOUR GET A FREE CONSULTATION

Stay in touch!

This field is for validation purposes and should be left unchanged.