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
9c44c2a0
Commit
9c44c2a0
authored
Nov 08, 2013
by
David Stutz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#177 docs.
parent
19f72356
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
9 deletions
+28
-9
index.html
index.html
+28
-9
No files found.
index.html
View file @
9c44c2a0
...
...
@@ -518,21 +518,40 @@
$(
'
.multiselect
'
).multiselect({
buttonText: function(options, select) {
if (options.length == 0) {
return
'
None selected
<
b class="caret"
><
/b
>'
;
}
else if (options.length > 3) {
return options.length +
'
selected
<
b class="caret"
><
/b
>'
;
return this.nonSelectedText + '
<
b class="caret"
><
/b
>
';
}
else {
var selected =
''
;
options.each(function() {
selected += $(this).text() +
'
,
'
;
});
return selected.substr(0, selected.length -2) +
'
<
b class="caret"
><
/b
>'
;
if (options.length > this.numberDisplayed) {
return options.length + ' ' + this.nSelectedText + '
<
b class="caret"
><
/b
>
';
}
else {
var selected = '';
options.each(function() {
var label = ($(this).attr('label') !== undefined) ? $(this).attr('label') : $(this).html();
selected += label + ', ';
});
return selected.substr(0, selected.length - 2) + '
<
b class="caret"
><
/b
>
';
}
}
}
});
});
<
/script
>
</pre>
</td>
</tr>
<tr>
<td><code>
numberDisplayed
</code></td>
<td>
This option can be used to define the number of displayed option before the text defined in
<code>
nSelectedText
</code>
is used. This option may not be available when using a custom
<code>
buttonText
</code>
function.
</td>
<td>
<pre
class=
"prettyprint linenums"
>
<
script type=
"
text/javascript
">
$(document).ready(function() {
$(
'
.multiselect
'
).multiselect({
numberDisplayed: 4
});
});
<
/script
>
</pre>
</td>
...
...
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