Comments (5)
Could you give me an example of what you would need?
from jquery.sumoselect.
I think he would like the attributes set against the regular options transferring to the equivalent "li".
so when this is "converted" to a sumoselect:
{select}
{option data-whatever="test">option1{/option}
{option data-something="else">option2{/option}
{/select}
it ends up like this:
{div class="optWrapper"}
{ul class="options"}
{li class="opt selected" data-whatever="test"}{label}option1{/label}{/li}
{li class="opt" data-something="else"}{label}option2{/label}{/li}
{/ul}
{/div}
from jquery.sumoselect.
Yes. It's what I want to achieve. Thank you
I think he would like the attributes set against the regular options transferring to the equivalent "li". so when this is "converted" to a sumoselect: {select} {option data-whatever="test">option1{/option} {option data-something="else">option2{/option} {/select}
it ends up like this: {div class="optWrapper"} {ul class="options"} {li class="opt selected" data-whatever="test"}{label}option1{/label}{/li} {li class="opt" data-something="else"}{label}option2{/label}{/li} {/ul} {/div}
from jquery.sumoselect.
I see, I will handle this as soon as I have time
from jquery.sumoselect.
This would do it:
in the createLi()...
I changed:
// AzzaAzza69 : create without any attributes (including class!)
const li = $(`<li><label>${opt.html()}</label></li>`);
// +AzzaAzza69 : copy all attributes from original option to new list item
for(attr of opt[0].attributes) {
li[0].setAttribute(attr.name, attr.value);
}
li[0].classList.add('opt');
...
// -AzzaAzza69 : new attribute copy will pull these across
// if (opt.attr('class'))
// li.addClass(opt.attr('class'));
// if (opt.attr('title'))
// li.attr('title', opt.attr('title'));
...
from jquery.sumoselect.
Related Issues (20)
- Option to save selection to local storage HOT 3
- Usability improvement: Scroll (first) selected into view when dropping list down... HOT 1
- jQuery 3.3 compatibility: jQuery.fn.click() event shorthand is deprecated. HOT 1
- Bug + Fix: Search box doesn't handle changes actioned via context menu... HOT 1
- Bug + fix: When search: true, the keyboard Enter/Escape don't re-focus the .SumoSelect HOT 1
- Enhancement: Search input to use the type="search"... HOT 1
- Enhancement + Fix: If the original 'hidden' select ever gets focus, focus the sumo one instead HOT 3
- Is there a way to order the option? HOT 1
- Add option to avoid duplicating the original class attribute HOT 1
- Selected values not displaying in Firefox HOT 1
- UnSelectAll() Does Not Clear Selected Options UI HOT 1
- Add a New selectAllVisible Option HOT 3
- How to get the selected value? HOT 1
- Automatic up/down instead of static HOT 3
- Possible bug when using an outer label for accessibility reasons HOT 2
- Bug: Can't use options okCancelInMulti and ClearAll at the same time HOT 1
- Cannot Use SelectAll on mobile browsers
- renderLi examples or documenation?
- Search and Multi Select: When searching, UI does not respond for a long time if I have many select options(>3000)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery.sumoselect.