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
7f80e5aa
Commit
7f80e5aa
authored
Oct 09, 2014
by
David HAN SZE CHUEN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show that the dataprovider method supports `selected` and `caption` properties
parent
9571dd5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
17 deletions
+37
-17
index.html
index.html
+37
-17
No files found.
index.html
View file @
7f80e5aa
...
...
@@ -1309,20 +1309,29 @@ $(document).ready(function() {
$
(
'
#example36-enable
'
).
on
(
'
click
'
,
function
()
{
$
(
'
#example36
'
).
multiselect
(
'
enable
'
);
});
var
data
=
[
{
label
:
'
Cheese
'
,
value
:
'
cheese
'
},
{
label
:
'
Tomatoes
'
,
value
:
'
tomatoes
'
}
{
label
:
'
Cheese
'
,
value
:
'
cheese
'
,
caption
:
'
Swiss cheese
'
},
{
label
:
'
Tomatoes
'
,
value
:
'
tomatoes
'
,
caption
:
'
Red tomato
'
,
selected
:
true
}
];
$
(
'
#example49
'
).
multiselect
();
$
(
'
#example49
'
).
multiselect
(
'
dataprovider
'
,
data
);
$
(
'
#example49
'
).
multiselect
().
multiselect
(
'
dataprovider
'
,
data
);
var
data
=
[
{
title
:
'
First group
'
,
children
:
[{
label
:
'
Cheese
'
,
value
:
'
cheese
'
},
{
label
:
'
Tomatoes
'
,
value
:
'
tomatoes
'
}]},
{
title
:
'
Second group
'
,
children
:
[{
label
:
'
Mozzarella
'
,
value
:
'
mozzarella
'
},
{
label
:
'
Mushrooms
'
,
value
:
'
mushrooms
'
}]},
{
title
:
'
First group
'
,
children
:
[
{
label
:
'
Cheese
'
,
value
:
'
cheese
'
,
caption
:
'
Swiss cheese
'
,
selected
:
true
},
{
label
:
'
Tomatoes
'
,
value
:
'
tomatoes
'
,
caption
:
'
Red tomato
'
}
]
},
{
title
:
'
Second group
'
,
children
:
[
{
label
:
'
Mozzarella
'
,
value
:
'
mozzarella
'
,
caption
:
'
Italian cheese
'
},
{
label
:
'
Mushrooms
'
,
value
:
'
mushrooms
'
,
caption
:
'
French mushroom
'
}
]
}
];
$
(
'
#example50
'
).
multiselect
();
$
(
'
#example50
'
).
multiselect
(
'
dataprovider
'
,
data
);
$
(
'
#example50
'
).
multiselect
().
multiselect
(
'
dataprovider
'
,
data
);
});
</script>
<table
class=
"table table-striped"
>
...
...
@@ -1445,21 +1454,32 @@ $(document).ready(function() {
<p>
Provides data for building the select's options the following way:
</p>
<pre
class=
"prettyprint linenums"
>
<pre
class=
"prettyprint linenums"
style=
"max-width: none"
>
var data = [
{
label: 'Cheese', value: 'cheese'
},
{
label: 'Tomatoes', value: 'tomatoes'
}
{
label: 'Cheese', value: 'cheese', caption: 'Swiss cheese', selected: true
},
{
label: 'Tomatoes', value: 'tomatoes', caption: 'Red tomato'
}
];
$(
"
#multiselect
"
).multiselect('dataprovider', data);
$(
'multiselect'
).multiselect('dataprovider', data);
</pre>
<p>
Alternatively, this method can also be used to build option groups (
<a
target=
"_blank"
href=
"https://github.com/davidstutz/bootstrap-multiselect/pull/281"
>
#281
</a>
):
</p>
<pre
class=
"prettyprint linenums"
>
<pre
class=
"prettyprint linenums"
style=
"max-width: none"
>
var data = [
{title: 'First group', children: [{label: 'Cheese', value: 'cheese'}, {label: 'Tomatoes', value: 'tomatoes'}]},
{title: 'Second group', children: [{label: 'Mozzarella', value: 'mozzarella'}, {label: 'Mushrooms', value: 'mushrooms'}]},
{
title: 'First group',
children: [
{ label: 'Cheese', value: 'cheese', caption: 'Swiss cheese' },
{ label: 'Tomatoes', value: 'tomatoes', caption: 'Red tomato', selected: true }
]
}, {
title: 'Second group',
children: [
{ label: 'Mozzarella', value: 'mozzarella', caption: 'Italian cheese' },
{ label: 'Mushrooms', value: 'mushrooms', caption: 'French mushroom' }
]
}
];
$('.multiselect').multiselect('dataprovider', data);
</pre>
...
...
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