filipbartos / heapbox Goto Github PK
View Code? Open in Web Editor NEWjQuery <selectbox> replacement
Home Page: https://is.gd/1GdRnV
License: MIT License
jQuery <selectbox> replacement
Home Page: https://is.gd/1GdRnV
License: MIT License
Hum, that's possible, but not straightforward.
you have to find the ".heapBox" related to your select. Depending how you inserted it, it will be before, after or inplace.
$myHeapBox= ....find('.heapBox');
then select the option (by value) you want
$myHeapBox.find('.heapOptions [rel="'+ theValueYouWantToSelect +'"]').click();
So a shortcut would be nice to have. Not to mention it will be safer as I'm relying on your structure here and if you change it, my code will break.
Cheers and kudos for the good job you did on this simple and efficient dropdown.
First of all thanks for such a awesome plugin. Can you please add keyboard support? for Exa. Press Esc to Close Heapbox, Up/Down arrow for change option like default select box behavior.
Again thanks for your hardwork!
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library FilipBartos/heapbox
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "FilipBartos/heapbox",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
Hi @FilipBartos ,
I am a member of cdnjs, we are going to host this library.
But there is an issue about naming scheme. If use jquery.heapbox-0.9.4.min.js
The auto-update of cdnjs can't work well.
Would you like to change the naming scheme?
Using jquery.heapbox.min.js
is better for cdnjs auto-update.
If you have any suggestions, please let me know.
Thank you.
Is there a way to open a heapbox (an keep it open until an element is selected or the handler is clicked) by clicking some other element on the page except the handler.
Hi nice job on the heapbox.
I've been working with the ajax method of updating select boxes for chained selects and have it working but have noticed an issue with the sliders.
I'll do my best to eplain and drop in some simpler code using the dynamic json method to recreate the issue.
When using long lists and using heapsize the dynamic methods and the sliders fail if the heapboxes aren't the same size, as in number of options.
On your website examples with the Ajax method it works fine because the options are the same number in each select.
To see the problem simply lose a few options on one of the selects and change the values.
It's like the heapsize isn't being updated and the sliders don't know when to stop scrolling.
I've looked through the code for a refresh function but the best I could find was the update function, which of course reverts the select box back to it's original state.
here's some code for you to see using the dynamic json method.
$(document).ready(function() {
$(".basic-example").heapbox({"heapsize":"100px"});
$(".basic-example").heapbox();
json = '[{"value":"dynamic_value_1","text":"Dynamic value 1"},{"value":"dynamic_value_2","text":"Dynamic value 2"},{"value":"dynamic_value_3","text":"Dynamic value 3"},{"value":"dynamic_value_4","text":"Dynamic value 4"},{"value":"dynamic_value_5","text":"Dynamic value 5"}]';
$(".basic-example").heapbox("set",json);
$(".basic-example2").heapbox({
'onChange':function(){
$(".basic-example2").heapbox("update");
$(".basic-example").heapbox("update");}});});
What about if anyone tries to address the heapbox? when creating a one it assign the first element of it as an address, what if i want to give it an address then when opening it, it gives me the items in it...
First of all thanks for this awesome plugin!
It works very well on desktop, but lacks user friendliness on mobile devices.
It would be nice if the plugin detected mobile devices and opened the device native select window instead of opening the heapbox dropdown (which can be quite long = annoying to control on a small mobile screen).
Thanks
Hey, thanks for your work on this. Is there any way to update the heapbox when the underlying options have changed?
Thanks
I'd think it kinda essential that a replacements reads and respects the selected option of an select. HeapBix doesn't.
Hi ,
maybe you wand to add this._handleFirst() in function 'set':
/*
* Set own data to heap
*/
set: function(data) {
this._setData(data);
this._setHolderTitle();
this._setEvents();
** this._handleFirst();**
},
What about <optgroup>
tag support and multiple
, size
attributes?
Cool thing, but is not useful for me without this.
Why HTML markup is ignored?
Is it possible to add html content support at least as optional feature?
Selected item may be text only, but in drop-down html content should be supported.
Would be nice to add a new method to Reset a heapbox instance programmatically. Any ideas on this?
This is the script code :
$(".basic-example").heapbox({
"heapsize":"100px",
'openComplete':function(){alert('box open')},
'closeStart':function(value){alert('Selected value: '+value)},
'closeCompleted':function(value){alert('Selected value: '+value)}
});
I am using the version 0.9.3(latest)
Depending on the loading order, the line linked below may stop click events on other plugins or site code:
https://github.com/FilipBartos/heapbox/blob/master/src/jquery.heapbox-0.9.4.js#L72
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.