{hero}

searchBuilder.depthLimit

Since: SearchBuilder 1.0.0

Impose a limit on the depth of the groups.
Please note - this property requires the SearchBuilder extension for DataTables.

Description

This option allows for a limit to be set on how deep sub groups can be placed from the top level. The top level is considered the first level. Setting a searchBuilder.depthLimit of 2 would allow for criteria to be indented by 1 level as this would then be at the second level - the limit.

As default the limit is false, meaning that criteria can be indented as far as desired.

Take a look at this example to see this in action.

Types

integer

Description:

The value for how many layers deep a group can be at most.

boolean

Description:

When false, don't impose a limit on the depth of groups.

Default

  • Value: false

The default value for this option is false meaning that as standard there will be no limit on the depth of the groups.

Examples

Setting the limit to 3:

new DataTable('#myTable', {
	layout: {
		top1: {
			searchBuilder: {
				depthLimit: 3
			}
		}
	}
});

Never allow sub grouping:

new DataTable('#myTable', {
	layout: {
		top1: {
			searchBuilder: {
				depthLimit: 1
			}
		}
	}
});