Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

[Added] Subform Filter

Information about updates, news, Code Library
admin
Site Admin
Posts: 2720
Joined: Mon Jun 15, 2009 2:23 am
nuBuilder Version: 4.5

[Added] Subform Filter

Unread post by admin »

The new function nuSubformAddFilter() allows you to add filters to a subform.
Two different filter types exist:

1) select / dropdown
2) search (with an optional datalist with autocomplete)
subform_filters.gif
subform_filters.gif (354.2 KiB) Viewed 84 times


In the following examples, sfObjId is used as subform object id. The code can to be placed in the (main) form's Custom Code.

:arrow: Example 1:

Add filters of type "select" to all columns:

Code: Select all

var sfFilter = {};
sfFilter['sfObjId']  = nuSubformTitleArray('objform');
nuSubformAddFilter(sfFilter);
:arrow: Example 2:

Add select filters to certain columns:

Code: Select all

var sfFilter = {};
var sfFilter['sfObjId'] = [
	'col_1',
	'col_2',
	'col_3'
];

nuSubformAddFilter(sfFilter);
:arrow: Advanced Example 3:

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);

:arrow: There's even more than that! It's possible to create custom filters values & filter logic. (Stay tuned for the documentation!)
Post Reply