$.udb(ds).setQueryHook()
note
This article is about the setQueryHook() function of the DataSourceContainer object.
$.udb(ds).setQueryHook()
Specifies a function that is called for each search condition set on a column, passing the column reference and the actual search value used in that condition. This can be used, for example, to add wildcards for text field search conditions, which may use translated string values for different languages at run-time.
Returns the UdbDsc object on which the function was called.
Syntax
$.udb( *ds* ).setQueryHook( function( *column-reference*, *search-value* ) )
The optional ds is a data source selector.
Column-reference is a valid reference to a column, i.e. a name or its alias. Search-value is the actual value of the search condition.
Example
var dsc = $.udb('EMP');
dsc.setQueryHook((colRef, value) => {
if (!dsc.cols(colRef).getLookups().length)
return '%' + value + '%';
else
return value;
});