styopdev / multipicker Goto Github PK
View Code? Open in Web Editor NEWForm styling plugin for jQuery
Home Page: http://styopdev.github.io/multiPicker/
License: MIT License
Form styling plugin for jQuery
Home Page: http://styopdev.github.io/multiPicker/
License: MIT License
Hey,
I'm using Lists with the multiPicker.
Everything worked fine unless I started to implement an edit-function within my application.
I tried to auto-select the Options (li items) with the prePopulate option. $("#alarmdays").multiPicker({ selector : "li", prePopulate : data.data.days });
Works ok for me, but when some of the Elements are already active, they'll be unselected by this function, also it doesn't clear the past selection so I may end up with a mess.
I could not find a simple "Unselect()" function in the documentation.
My workaround right now is to delete the value of the hidden field and remove the "active" classes from the options by:
$('input[name=alarmdays]').val('');
$("#alarmdays").children().removeClass('active');
If there already are functions like this, im sorry.
Otherwise it would be a great improvement.
EDIT:
Actually the "prePopulate" doesn't work for me, as I can't change the selection afterwards.
I created these two handy helper functions:
// -- Helper to unselect a list
function unselect(list) {
$('input[name='+list+']').val('');
$("#"+list).children().removeClass('active');
}
// -- Helper to select options in a list
function select(list, elements) {
$("#"+list+" li").each(function( index ) {
if($.inArray( index, elements ) >= 0) {
$( this ).click();
}
});
}
If i set the parameter isSingle: true
the onSelect
event stops working
Hi @styopdev,
I'm trying to get the selected value from the following checkboxes.
<input type="checkbox" value="3" name="clubs"> <input type="checkbox" value="1" name="clubs">
using the following native js way.
document.querySelector('input[name="clubs"]:checked').value
it doesn't return any value. However it works once I remove multipicker js.
I need this native method to get the selected values 'cause I'm trying to use this multiselector for a larger array of selection -
is there an easy way to use this with your api without creating multipcker objects for all instances?
Hi,
You need implement the API access & events, in this way the coders can use it via js.
Thanks ;)
Best Regards.
Hi there
Thanks for this wonderful work. I'd like to return all selected values using the onSelect method. Please advise. Thanks
I am having troubles to work this plugin with elements that have more than 5 or 6 letters.
I have been using it for yes or no options but when I try to use it with words, the elements are not placed with the right padding.
The dependencies in my bower.json are:
"jquery": "~2.1.3",
"fontawesome": "~4.3.0",
"Chart.js": "~1.0.2",
"metisMenu": "~1.1.3",
"multipicker": "^1.1.2"
I have opened the inspector and removed each dependency but I still can't see it well
I'm using the following config for the example on the right:
cssOptions : {
"vertical": true,
"quadratic": true,
"element": {
"width": "100%",
"color": "#000"
},
"selected": {
"background": "#C1F5B0",
"border-color": "2px solid green"
}
}
I was expecting the border to behave like the left example.
Any chance to fix it?
Hey,
I used your code in a tiny app.
The multiple select feature is nice, but it also selects the text.
I used following code in the
.unselectable {
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
Maybe an option to enhance the script?
Hi,
Nice plugin ;)
But missing important functionality of enabled/disabled.
Best Regards.
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.