Giter Club home page Giter Club logo

listbox.js's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

listbox.js's Issues

How to deselect the multiple selected options?)

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..

Keep item values

listbox.js Line #176

was:

            .text(parentItem.text())
            .click(function () {

became:

            .text(parentItem.text())
            .val(parentItem.val())
            .click(function () {

MutationObserver

The Listbox.js should listen all parent changes and adopt itself in this way.

How to add item dynamic ?

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?
 });

The plugin doesn't update <select> element's value.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.