Two different filter types exist:
1) select / dropdown
2) search (with an optional datalist with autocomplete)
In the following examples, sfObjId is used as subform object id. The code can to be placed in the (main) form's Custom Code.
Example 1:
Add filters of type "select" to all columns:
Code: Select all
var sfFilter = {};
sfFilter['sfObjId'] = nuSubformTitleArray('objform');
nuSubformAddFilter(sfFilter);
Add select filters to certain columns:
Code: Select all
var sfFilter = {};
var sfFilter['sfObjId'] = [
'col_1',
'col_2',
'col_3'
];
nuSubformAddFilter(sfFilter);
Add select and search type filters and use custom options.
- if blank: true: Add an empty option in the select filter
- all: "a description": Use a custom text for the "(All)" option
- datalist: true: Activate autocomplete
- width: width of the filter object (default: width of the column)
- float: horizontal alignment (default: center, left, right)
Code: Select all
var OPTION_ALL = nuTranslate('(All)');
var sfFilter = {};
var sfFilter['sfObjId'] = {
'col_1': {type: 'select', blank: true, width: 120, float: 'right', all: OPTION_ALL},
'col_2': {type: 'select', blank: true, all: OPTION_ALL},
'col_3': {type: 'search', datalist: true, blank: true, all: OPTION_ALL}
};
nuSubformAddFilter(sfFilter);
There's even more than that! It's possible to create custom filters values & filter logic. (Stay tuned for the documentation!)