GithubHelp home page GithubHelp logo

Comments (3)

mlh758 avatar mlh758 commented on May 28, 2024

You might consider using the removeOption method on the widget. The options that are rendered are li tags not option tags. The widget just uses the option tags from the original select to build the list before the widget takes the place of and hides the underlying select.

Otherwise you might try using css to hide li tags with no text that are under the ui-multiselect-checkboxes css class.

from jquery-ui-multiselect-widget.

 avatar commented on May 28, 2024

You might consider using the removeOption method on the widget. The options that are rendered are li tags not option tags. The widget just uses the option tags from the original select to build the list before the widget takes the place of and hides the underlying select.

Otherwise you might try using css to hide li tags with no text that are under the ui-multiselect-checkboxes css class.

Otherwise you might try using css to hide li tags with no text that are under the ui-multiselect-checkboxes css class.

This seems my best option I didn't know it rendered in li tags. So the css would then be
ui-multiselect-checkboxes li[value=""] {display: none'}

from jquery-ui-multiselect-widget.

mlh758 avatar mlh758 commented on May 28, 2024

If you inspect the HTML on the demo page, it's not the li that has a value but the input tag underneath it. You'd end up with a selector like 'li input[value=""]'. That selects the checkbox though. You would need some JavaScript to hide the parent based on that since I don't think css has a parent selector.

Something like: document.querySelectorAll('li input[value=""]').forEach((el) => el.closest('li').className = "hidden")

from jquery-ui-multiselect-widget.

Related Issues (20)

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.