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
eefc8ab6
Commit
eefc8ab6
authored
Nov 16, 2020
by
Craig Norris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor ajax style edits
Minor edits for style to Ajax page.
parent
5eddaaae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
doc/development/fe_guide/droplab/plugins/ajax.md
doc/development/fe_guide/droplab/plugins/ajax.md
+11
-9
No files found.
doc/development/fe_guide/droplab/plugins/ajax.md
View file @
eefc8ab6
...
...
@@ -6,18 +6,20 @@ info: To determine the technical writer assigned to the Stage/Group associated w
# Ajax plugin
`Ajax`
is a DropLab plugin that allows for retrieving and rendering list data from a server.
`Ajax`
is a DropLab plugin that allows for retrieving and rendering list data
from a server.
## Usage
Add the
`Ajax`
object to the plugins array of a
`DropLab.prototype.init`
or
`DropLab.prototype.addHook`
call.
Add the
`Ajax`
object to the plugins array of a
`DropLab.prototype.init`
or
`DropLab.prototype.addHook`
call.
`Ajax`
requires 2 configuration values
,
the
`endpoint`
and
`method`
.
`Ajax`
requires 2 configuration values
:
the
`endpoint`
and
`method`
.
-
`endpoint`
s
hould be a URL to the request endpoint.
-
`method`
s
hould be
`setData`
or
`addData`
.
-
`setData`
c
ompletely replaces the dropdown with the response data.
-
`addData`
a
ppends the response data to the current dropdown list.
-
`endpoint`
: S
hould be a URL to the request endpoint.
-
`method`
: S
hould be
`setData`
or
`addData`
.
-
`setData`
: C
ompletely replaces the dropdown with the response data.
-
`addData`
: A
ppends the response data to the current dropdown list.
```
html
<a
href=
"#"
id=
"trigger"
data-dropdown-trigger=
"#list"
>
Toggle
</a>
...
...
@@ -38,7 +40,7 @@ droplab.addHook(trigger, list, [Ajax], {
});
```
Optionally
you can set
`loadingTemplate`
to a HTML string. This HTML string will
replace the dropdown list while the request is pending.
Optionally
, you can set
`loadingTemplate`
to a HTML string. This HTML string
replace
s
the dropdown list while the request is pending.
Additionally, you can set
`onError`
to a function to catch any XHR errors.
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