.setQueryHook()

Previous Next

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

.setQueryHook( functioncolumn-referencesearch-value ) )

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.setSearchHook(function(colRef, value) {

   if (!dsc.cols(colRef).getLookups().length)

     return '%' + value + '%';

   else

     return value;

});