In the DeviceTable the "searchableColumns" functionality allows you to specify a list of searchable columns, excluding others. This can be useful for targeted searches for specific tasks.
This parameter must be added to the Configuration properties CKeditor form and considered an array of columns in the table.
{
"ordering":"dateObserved", "query":"https://www.snap4city.org/superservicemap/api/v1/iot-search/?selection=43.77;11.2&maxDists=2000.2&model=metrotrafficsensor",
"actions":["pin" ],
"columnsToShow":["id", "dateObserved", "avgTime", "concentration"],
"searchableColumns":["avgTime", "concentration"]
}
For example, given a table with a "City" column with a list of municipalities and a "Subject" column (Traffic, Pollution, Parking) specifying "searchableColumns":["City", "Subject"] in the configuration properties, it is possible to perform a search to return only results related to parking in Florence by typing "Florence Parking" in the DeviceTable search box, with the words separated by a space.
Please note that in some versions of the Device Table the search feature is not available. Moreover, in some version the JSON for the specification of the Device Table does not accept characters such as TAB, CR, LF, spaces, etc.
This type of search also allows for incomplete strings, so you can use "Flor" as the search term instead of "Florence". The default search mode instead requires complete input search.
Notes:
- The search is based on the original name of columns, not on the customized title specified on columnTitles.
- The id of the device must be written as deviceName.
- "Actions", being a special column, is not considered searchable.
– end--