Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap-multiselect
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap-multiselect
Commits
9e81cc45
Commit
9e81cc45
authored
Oct 22, 2013
by
Sergey Vychegzhanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added onDropdownShow & onDropdownHide handlers
parent
1da1db9a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
58 additions
and
8 deletions
+58
-8
index.html
index.html
+46
-8
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+12
-0
No files found.
index.html
View file @
9e81cc45
...
...
@@ -629,12 +629,12 @@
</pre>
</td>
</tr>
<tr>
<td><code>
onChange
</code></td>
<td>
This event handler is triggered when the selected options are changed.
</td>
<td>
<tr>
<td><code>
onChange
</code></td>
<td>
This event handler is triggered when the selected options are changed.
</td>
<td>
<pre
class=
"prettyprint linenums"
>
<
script type=
"
text/javascript
">
$(document).ready(function() {
...
...
@@ -646,8 +646,46 @@
});
<
/script
>
</pre>
</td>
</tr>
</td>
</tr>
<tr>
<td><code>
onDropdownShow
</code></td>
<td>
This event handler is triggered when the dropdown are shown.
</td>
<td>
<pre
class=
"prettyprint linenums"
>
<
script type=
"
text/javascript
">
$(document).ready(function() {
$(
'
.multiselect
'
).multiselect({
onDropdownShow: function(event) {
alert(
'
Show event invoked!
'
);
}
});
});
<
/script
>
</pre>
</td>
</tr>
<tr>
<td><code>
onDropdownHide
</code></td>
<td>
This event handler is triggered when the dropdown are hidden.
</td>
<td>
<pre
class=
"prettyprint linenums"
>
<
script type=
"
text/javascript
">
$(document).ready(function() {
$(
'
.multiselect
'
).multiselect({
onDropdownHide: function(event) {
alert(
'
Hide event invoked!
'
);
}
});
});
<
/script
>
</pre>
</td>
</tr>
<tr>
<td><code>
maxHeight
</code></td>
<td>
...
...
js/bootstrap-multiselect.js
View file @
9e81cc45
...
...
@@ -39,6 +39,8 @@
this
.
options
.
multiple
=
this
.
$select
.
attr
(
'
multiple
'
)
==
"
multiple
"
;
this
.
options
.
onChange
=
$
.
proxy
(
this
.
options
.
onChange
,
this
);
this
.
options
.
onDropdownShow
=
$
.
proxy
(
this
.
options
.
onDropdownShow
,
this
);
this
.
options
.
onDropdownHide
=
$
.
proxy
(
this
.
options
.
onDropdownHide
,
this
);
// Build select all if enabled.
this
.
buildContainer
();
...
...
@@ -94,6 +96,14 @@
// Is triggered on change of the selected options.
onChange
:
function
(
option
,
checked
)
{
},
// Triggered immediately when dropdown shown
onDropdownShow
:
function
(
event
)
{
},
// Triggered immediately when dropdown hidden
onDropdownHide
:
function
(
event
)
{
},
buttonClass
:
'
btn
'
,
dropRight
:
false
,
...
...
@@ -129,6 +139,8 @@
buildContainer
:
function
()
{
this
.
$container
=
$
(
this
.
options
.
buttonContainer
);
this
.
$container
.
on
(
'
show.bs.dropdown
'
,
this
.
options
.
onDropdownShow
);
this
.
$container
.
on
(
'
hide.bs.dropdown
'
,
this
.
options
.
onDropdownHide
);
},
buildButton
:
function
()
{
...
...
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