ikalnytskyi / listbox.js Goto Github PK
View Code? Open in Web Editor NEWListbox.js is a simple jQuery plugin that provides a more powerful alternative to the standard `<select>` tag.
Home Page: http://plugins.jquery.com/listbox/
License: Other
Listbox.js is a simple jQuery plugin that provides a more powerful alternative to the standard `<select>` tag.
Home Page: http://plugins.jquery.com/listbox/
License: Other
My question is simple, I just couldn't reset(deselect) the selected options with a button. So any help?)
$(function () {
$('select#packages').listbox({'searchbar': true});
$('#sendBtn').click(function() {
var obj = $('#packages option:selected');
$.each( obj, function( key, value ) {
$('#textarea').append(value.text + " \n");
});
$('#packagesModal').modal('hide');
});
});
This code works but I need to reset selections with #sendBtn because in the next times it all comes selected..
The ListBox has rendering problems when using IE7.
listbox.js Line #176
was:
.text(parentItem.text())
.click(function () {
became:
.text(parentItem.text())
.val(parentItem.val())
.click(function () {
The Listbox.js
should listen all parent changes and adopt itself in this way.
Can I use the listbox and add item dynamic ?
HTML
<select id="selList" style="font-size:small;">
<option>BANANA</option>
</select>
var myarray= [ "Apple" , "Orange" ] ;
$.each(myarray,function (idx,value) {
//How to add item from array to select object?
});
Hi.
We have just faced with the following minor issue: the plugin doesn't update binded <select>
element's value when user selects an option in the listbox.
Yes, it sets selected
attribute to the corresponding <option>
element, but not to the <select>
. So, JavaScript handlers which have been assigned to <select>
change
event aren't triggered.
A standard behavior is:
<select id="test" name="test">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
<option value="5">Option 5</option>
</select>
$(function(){
$('#test').on('change', function() {
console.log($(this).val());
});
});
So if you have selected an option, there will be an updated value in the console output.
Provided change
event handler doesn't being triggered when you have changed your selection in the listbox.
I've just forked your plugin. I can provide a pull request in the evening. I think.
Or, if you would like to, I can post a diff in the issue comment.
Regards, Ievgenii.
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.