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
1da1db9a
Commit
1da1db9a
authored
Oct 17, 2013
by
David Stutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#171
parent
83fa65fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
22 deletions
+69
-22
index.html
index.html
+52
-19
bootstrap-multiselect.js
js/bootstrap-multiselect.js
+17
-3
No files found.
index.html
View file @
1da1db9a
...
...
@@ -110,10 +110,6 @@
buttonClass
:
'
btn btn-default btn-sm
'
});
$
(
'
#example5
'
).
multiselect
({
buttonClass
:
'
btn btn-primary disabled
'
});
$
(
'
#example6
'
).
multiselect
();
$
(
'
#example9
'
).
multiselect
({
...
...
@@ -276,21 +272,6 @@
Small button using
<code>
buttonClass:
'
btn btn-default btn-sm
'
</code>
.
</td>
</tr>
<tr>
<td>
<select
id=
"example5"
multiple=
"multiple"
>
<option
value=
"cheese"
>
Cheese
</option>
<option
value=
"tomatoes"
>
Tomatoes
</option>
<option
value=
"mozarella"
>
Mozzarella
</option>
<option
value=
"mushrooms"
>
Mushrooms
</option>
<option
value=
"pepperoni"
>
Pepperoni
</option>
<option
value=
"onions"
>
Onions
</option>
</select>
</td>
<td>
Disabled using
<code>
buttonClass:
'
btn btn-primary disabled
'
</code>
.
</td>
</tr>
<tr>
<td>
<div
class=
"input-group btn-group"
>
...
...
@@ -852,6 +833,16 @@
$
(
'
#example18-mushrooms
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#example18
'
).
multiselect
(
'
deselect
'
,
'
mushrooms
'
);
});
$
(
'
#example35
'
).
multiselect
();
$
(
'
#example35-disable
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#example35
'
).
multiselect
(
'
disable
'
);
});
$
(
'
#example36
'
).
multiselect
();
$
(
'
#example36-enable
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#example36
'
).
multiselect
(
'
enable
'
);
});
});
</script>
<table
class=
"table table-striped"
>
...
...
@@ -988,6 +979,48 @@ $("#multiselect").multiselect('dataprovider', data);
<p>
Used to change configuration after initializing the multiselect. This may be useful in combination with
<code>
.multiselect('rebuild')
</code>
.
</p>
</td>
</tr>
<tr>
<td>
<p><code>
.multiselect('disable')
</code></p>
<p>
Disable both the underlying select and the dropdown button.
</p>
</td>
<td>
<div
class=
"btn-group"
>
<select
id=
"example35"
multiple=
"multiple"
>
<option
value=
"cheese"
>
Cheese
</option>
<option
value=
"tomatoes"
>
Tomatoes
</option>
<option
value=
"mozarella"
>
Mozzarella
</option>
<option
value=
"mushrooms"
>
Mushrooms
</option>
<option
value=
"pepperoni"
>
Pepperoni
</option>
<option
value=
"onions"
>
Onions
</option>
</select>
<button
id=
"example35-disable"
class=
"btn btn-default"
>
Disable
</button>
</div>
</td>
</tr>
<tr>
<td>
<p><code>
.multiselect('enable')
</code></p>
<p>
Enable both the underlying select and the dropdown button.
</p>
</td>
<td>
<div
class=
"btn-group"
>
<select
id=
"example36"
multiple=
"multiple"
disabled=
"disabled"
>
<option
value=
"cheese"
>
Cheese
</option>
<option
value=
"tomatoes"
>
Tomatoes
</option>
<option
value=
"mozarella"
>
Mozzarella
</option>
<option
value=
"mushrooms"
>
Mushrooms
</option>
<option
value=
"pepperoni"
>
Pepperoni
</option>
<option
value=
"onions"
>
Onions
</option>
</select>
<button
id=
"example36-enable"
class=
"btn btn-default"
>
Enable
</button>
</div>
</td>
</tr>
</tbody>
...
...
js/bootstrap-multiselect.js
View file @
1da1db9a
...
...
@@ -136,11 +136,11 @@
this
.
$button
=
$
(
this
.
templates
.
button
).
addClass
(
this
.
options
.
buttonClass
);
// Adopt active state.
if
(
this
.
$select
.
attr
(
'
disabled
'
)
==
undefined
)
{
this
.
$button
.
removeClass
(
'
disabled
'
);
if
(
this
.
$select
.
prop
(
'
disabled
'
)
)
{
this
.
disable
(
);
}
else
{
this
.
$button
.
addClass
(
'
disabled
'
);
this
.
enable
(
);
}
// Manually add button width if set.
...
...
@@ -558,6 +558,20 @@
this
.
rebuild
();
},
// Enable button.
enable
:
function
()
{
this
.
$select
.
prop
(
'
disabled
'
,
false
);
this
.
$button
.
prop
(
'
disabled
'
,
false
)
.
removeClass
(
'
disabled
'
);
},
// Disable button.
disable
:
function
()
{
this
.
$select
.
prop
(
'
disabled
'
,
true
);
this
.
$button
.
prop
(
'
disabled
'
,
true
)
.
addClass
(
'
disabled
'
);
},
// Set options.
setOptions
:
function
(
options
)
{
this
.
options
=
this
.
mergeOptions
(
options
);
...
...
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