$.udb(ds).setQueryHook()
note
This article is about the setQueryHook() function of the DataSourceContainer object.
$.udb(ds).setQueryHook()
Specifies a function used for each search column condition that has been set, and the actual search value used as search condition. This can be used, for example, to add wildcards for text field search conditions.
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(function(colRef, value) {
if (!dsc.cols(colRef).getLookups().length)
return '%' + value + '%';
else
return value;
});