Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
da8e959c
Commit
da8e959c
authored
Nov 16, 2020
by
Craig Norris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor filter edits
Minor style edits to filter plugin page.
parent
eefc8ab6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
doc/development/fe_guide/droplab/plugins/filter.md
doc/development/fe_guide/droplab/plugins/filter.md
+11
-8
No files found.
doc/development/fe_guide/droplab/plugins/filter.md
View file @
da8e959c
...
@@ -11,11 +11,12 @@ to the dropdown using a simple fuzzy string search of an input value.
...
@@ -11,11 +11,12 @@ to the dropdown using a simple fuzzy string search of an input value.
## Usage
## Usage
Add the
`Filter`
object to the plugins array of a
`DropLab.prototype.init`
or
`DropLab.prototype.addHook`
call.
Add the
`Filter`
object to the plugins array of a
`DropLab.prototype.init`
or
`DropLab.prototype.addHook`
call.
-
`Filter`
r
equires a configuration value for
`template`
.
-
`Filter`
: R
equires a configuration value for
`template`
.
-
`template`
should be the key of the objects within your data array that you want to compare
-
`template`
: Should be the key of the objects within your data array that you
to the user input string, for filtering.
want to compare
to the user input string, for filtering.
```
html
```
html
<input
href=
"#"
id=
"trigger"
data-dropdown-trigger=
"#list"
>
<input
href=
"#"
id=
"trigger"
data-dropdown-trigger=
"#list"
>
...
@@ -45,8 +46,10 @@ droplab.addData('trigger', [{
...
@@ -45,8 +46,10 @@ droplab.addData('trigger', [{
}]);
}]);
```
```
Above, the input string will be compared against the
`test`
key of the passed data objects.
In the previous code, the input string is compared against the
`test`
key of the
passed data objects.
Optionally you can set
`filterFunction`
to a function. This function will be used instead
Optionally you can set
`filterFunction`
to a function. This function will be
of
`Filter`
's built in string search.
`filterFunction`
is passed 2 arguments, the first
used instead of
`Filter`
's built-in string search.
`filterFunction`
is passed
is one of the data objects, the second is the current input value.
two arguments: the first is one of the data objects, and the second is the
current input value.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment