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
fa69d4fc
Commit
fa69d4fc
authored
Mar 17, 2015
by
davidstutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Example for #484.
parent
fcf8d04b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
1 deletion
+53
-1
bootstrap-multiselect.js
dist/js/bootstrap-multiselect.js
+1
-1
index.html
index.html
+52
-0
No files found.
dist/js/bootstrap-multiselect.js
View file @
fa69d4fc
...
...
@@ -1098,7 +1098,7 @@
var
justVisible
=
typeof
justVisible
===
'
undefined
'
?
true
:
justVisible
;
if
(
justVisible
)
{
var
visibleCheckboxes
=
$
(
"
li input[type='checkbox']:
enabled
"
,
this
.
$ul
).
filter
(
"
:visible
"
);
var
visibleCheckboxes
=
$
(
"
li input[type='checkbox']:
not(:disabled)
"
,
this
.
$ul
).
filter
(
"
:visible
"
);
visibleCheckboxes
.
prop
(
'
checked
'
,
false
);
var
values
=
visibleCheckboxes
.
map
(
function
()
{
...
...
index.html
View file @
fa69d4fc
...
...
@@ -3891,6 +3891,58 @@ $(document).ready(function() {
&
lt
;
select
id=
"example-large-dataprovider"
multiple=
"multiple"></select>
</
pre
>
<p>
The following example illsutrates how to disable options using JavaScript.
</p>
<div
class=
"example"
>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
$
(
'
#example-disable-javascript
'
).
multiselect
({
includeSelectAllOption
:
true
});
$
(
'
#example-disable-javascript-disable
'
).
on
(
'
click
'
,
function
()
{
var
input
=
$
(
'
#example-disable-javascript-container input[value="3"]
'
);
var
option
=
$
(
'
#example-disable-javascript-container option[value="3"]
'
);
input
.
prop
(
'
disabled
'
,
true
);
option
.
prop
(
'
disabled
'
,
true
);
input
.
parent
(
'
label
'
).
parent
(
'
a
'
).
parent
(
'
li
'
).
addClass
(
'
disabled
'
);
});
$
(
'
#example-disable-javascript-check
'
).
on
(
'
click
'
,
function
()
{
var
options
=
''
;
$
(
'
#example-disable-javascript option:selected
'
).
each
(
function
()
{
options
+=
$
(
this
).
val
()
+
'
,
'
;
});
alert
(
options
.
substr
(
0
,
options
.
length
-
2
));
});
});
</script>
<div
class=
"btn-group"
id=
"example-disable-javascript-container"
>
<select
id=
"example-disable-javascript"
multiple=
"multiple"
>
<option
value=
"1"
>
Option 1
</option>
<option
value=
"2"
>
Option 2
</option>
<option
value=
"3"
>
Option 3
</option>
<option
value=
"4"
>
Option 4
</option>
<option
value=
"5"
>
Option 5
</option>
<option
value=
"6"
>
Option 6
</option>
</select>
<button
id=
"example-disable-javascript-disable"
class=
"btn btn-primary"
>
Disable an option!
</button>
<button
id=
"example-disable-javascript-check"
class=
"btn btn-primary"
>
Check
</button>
</div>
</div>
<div
class=
"highlight"
>
<pre
class=
"prettyprint linenums"
>
$(document).ready(function() {
$('#example-disable-javascript').multiselect();
});
<
select id=
"
example-disable-javascript
"
multiple=
"
multiple
"><
/select
>
</pre>
<div
class=
"page-header"
>
<h2
id=
"post"
>
Server-Side Processing
</h2>
</div>
...
...
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