File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,7 @@ <h3><a name="methods" class="anchor" href="#methods"></a>Methods</h3>
272272
273273 </ li >
274274 < li >
275- < p > < strong > < a name ="search " class ="achor " href ="#search "> </ a > search(searchString, columns)</ strong > < br >
275+ < p > < strong > < a name ="search " class ="achor " href ="#search "> </ a > search(searchString, columns, searchFunction )</ strong > < br >
276276 Searches the list</ p >
277277
278278< pre > < code class ="javascript "> itemsInList = [
@@ -285,7 +285,20 @@ <h3><a name="methods" class="anchor" href="#methods"></a>Methods</h3>
285285
286286listObj.search(); // Show all items in list
287287
288- listObj.search('Jonny', ['name']); // Only search in the 'name' column</ code > </ pre >
288+ listObj.search('Jonny', ['name']); // Only search in the 'name' column
289+
290+ listObj.search('Jonny', searchFunction); // Custom search for Jonny
291+
292+ listObj.search('Jonny', ['name'], searchFunction); // Custom search in the 'name' column</ code > </ pre >
293+ < p > The optional < code > searchFunction</ code > should be of the form:</ p >
294+
295+ < pre > < code class ="javascript "> function searchFunction(searchString, columns) {
296+ for (var k = 0, kl = listObj.items.length; k < kl; k++) {
297+ listObj.items[k].found = false;
298+ // Insert your custom search logic here, set found = true
299+
300+ }
301+ };</ code > </ pre >
289302
290303 </ li >
291304 < li >
You can’t perform that action at this time.
0 commit comments