searchbox
searchbox widget filters for search query in referenced dataset and updates all controls referencing the dataset. It can be easily linked to other controls by referencing the the same dataset.
Syntax
<div data-juci="searchbox" data-bind="ref: deliveries" data-searcher="searcher"></div>
data-bind.ref and data-searcher are mandatory for searchbox.
Attributes
-
data-juci {String} ¶A string with value searchbox.
-
data-search-delay {Number} ¶Number of milliseconds after which search can start processing.
-
data-searcher {String} ¶Name of function defined on the window scope. Called when a search string is entered in the options list. The function receives the following params,
Methods
-
clearSearch(bDontFireEvent) ¶Clears the searchbox results.Parameters:
-
bDontFireEvent
- Fires:
- clear
-
bDontFireEvent
-
getDelay() ¶Gets the current delay before the searchbox can start processing the search string.
- Returns:
- {Number}
-
search(val) ¶Searches for the query. This method calls data-searcher to filter the matching results.Parameters:
-
val
-
val
-
setDelay(delay, bInit) ¶Sets a delay before the searchbox can start processing the search string.Parameters:
-
delay{Number}
Delay before search is started, in milliseconds.
-
bInit
-
delay{Number}
Events
-
aftersearch(eventObj) ¶Fires when the search results are ready, but not updated to the dataset.Parameters:
-
eventObj{EventObject}
-
data{Array}
Array of items to be searched.
-
matchingData{Array}
Array of items matching with the search string.
-
searchedValue{String}
The search string.
-
data{Array}
-
eventObj{EventObject}
-
beforesearch(eventObj) ¶ CancellableFires before the search processing is started.Parameters:
-
eventObj{EventObject}
-
data{Array}
Array of items to be searched.
-
searchedValue{String}
The search string.
-
data{Array}
-
eventObj{EventObject}
-
clear(eventObj) ¶ CancellableFires when the searchbox is cleared.Parameters:
-
eventObj{EventObject}
-
eventObj{EventObject}
-
search(eventObj) ¶ CancellableFires when the search results are ready, but not updated to the dataset.Parameters:
-
eventObj{EventObject}
-
data{Array}
Array of items to be searched.
-
matchingData{Array}
Array of items matching with the search string.
-
searchedValue{String}
The search string.
-
data{Array}
-
eventObj{EventObject}