sidneywm / iconic-multiselect Goto Github PK
View Code? Open in Web Editor NEW๐ A multiselect component in Pure JS - Compatible with IE11
Home Page: https://sidneywm.github.io/iconic-multiselect/
License: MIT License
๐ A multiselect component in Pure JS - Compatible with IE11
Home Page: https://sidneywm.github.io/iconic-multiselect/
License: MIT License
Hello,
I'm trying to change the size (height and width) of the iconic multiselect, or to change the maximum number of items to show when the list is open (like maxlength), but I didn't succeed. Is it possible ?
thanks a lot
I've a selectbox with option-tags.
Than I am selecting one entry with this plugin, but the correct option-tag don't get the property "selected". This is not connected.
I added this feature on this way
` multiSelect.subscribe(function(event) {
switch (event.action) {
case 'ADD_OPTION':
$(selectorString + " option[value='" + event.value + "']").prop('selected', 'selected');
break;
case 'REMOVE_OPTION':
$(selectorString + " option[value='" + event.value + "']").prop('selected', '');
break;
}
});`
When you create 2 instances on one page than is this plugin confused and it works not correct.
the second instance has any entries and the first one all entries
I've a select box with some selected entries in the html-code.
than i am init the multi-box with
` const multiSelect = new IconicMultiSelect({
select: selectorString,
customCss: true
});
multiSelect.init();`
but the initial selected option-tags in the selectbox are not visible.
I could add it with
$(selectorString + " option[selected='selected']").each(function() { const value = this.value; const target = Array.from(multiSelect.domElements.options).find(function (el) { return el.dataset.value === value; }); multiSelect._handleOption( target, false); })
for making initial entries are visible.
Hi! If you have multiple select elements on a page (e.g. a table with rows and each row has a select form element) you can't set the multiselect plugin on all elements using the class property.
For instance:
<select class="foobar">
<option value="bread">Bread</option>
<option value="cereal">Cereal</option>
<option value="pasta">Pasta</option>
<option value="rice">Rice</option>
<option value="meat">Meat</option>
<option value="fish">Fish</option>
</select>
<select class="foobar">
<option value="bread">Bread</option>
<option value="cereal">Cereal</option>
<option value="pasta">Pasta</option>
<option value="rice">Rice</option>
<option value="meat">Meat</option>
<option value="fish">Fish</option>
</select>
This bit will only initialize the multiselect on the first select
element, not the second:
const foobar = new IconicMultiSelect({
select: ".foobar",
});
foobar.init();
As a work around, you can do this:
document.querySelectorAll("select").forEach(function (el) {
const foobar = new IconicMultiSelect({
select: "#" + el.id,
});
foobar.init();
})
But this is convoluted, and it requires that every select element has an id
property.
I put the Multiselect in a form and I want to return the selected item to my app. it did not work. is it needed to add additional options?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.