Skip to content

Commit 388b3bb

Browse files
committed
docs: update MultiSelect documentation
1 parent 8f80e46 commit 388b3bb

File tree

2 files changed

+252
-89
lines changed

2 files changed

+252
-89
lines changed

docs/assets/js/application.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,64 @@
121121
})
122122
})
123123

124+
var myMultiSelect = document.getElementById('multiSelect')
125+
// eslint-disable-next-line no-unused-vars
126+
var cuiMultiSelect = new coreui.MultiSelect(myMultiSelect, {
127+
name: 'multiSelect',
128+
options: [
129+
{
130+
value: 0,
131+
text: 'Angular'
132+
},
133+
{
134+
value: 1,
135+
text: 'Bootstrap',
136+
selected: true
137+
},
138+
{
139+
value: 2,
140+
text: 'React.js',
141+
selected: true
142+
},
143+
{
144+
value: 3,
145+
text: 'Vue.js'
146+
},
147+
{
148+
label: 'backend',
149+
options: [
150+
{
151+
value: 4,
152+
text: 'Django'
153+
},
154+
{
155+
value: 5,
156+
text: 'Laravel'
157+
},
158+
{
159+
value: 6,
160+
text: 'Node.js',
161+
selected: true
162+
}
163+
]
164+
}
165+
],
166+
search: true
167+
})
168+
169+
console.log(myMultiSelect)
170+
171+
// var myMultiSelect2 = document.getElementById('multiSelect')
172+
myMultiSelect.addEventListener('changed.coreui.multi-select', function (event) {
173+
console.log(event.value)
174+
})
175+
// console.log(myMultiSelect2)
176+
177+
var ms1 = document.getElementById('ms1')
178+
ms1.addEventListener('changed.coreui.multi-select', function (event) {
179+
console.log(event.value)
180+
})
181+
124182
// Insert copy to clipboard button before .highlight
125183
var btnHtml = '<div class="docs-clipboard"><button type="button" class="btn-clipboard btn btn-ghost-primary" title="Copy to clipboard"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><polygon fill="var(--ci-primary-color, currentColor)" points="408 432 376 432 376 464 112 464 112 136 144 136 144 104 80 104 80 496 408 496 408 432" class="ci-primary"/><path fill="var(--ci-primary-color, currentColor)" d="M176,16V400H496V153.373L358.627,16ZM464,368H208V48H312V200H464Zm0-200H344V48h1.372L464,166.627Z" class="ci-primary"/></svg></button></div>'
126184
document.querySelectorAll('div.highlight')

0 commit comments

Comments
 (0)