GithubHelp home page GithubHelp logo

Comments (6)

clutchDM avatar clutchDM commented on August 16, 2024

I'm getting the same error in a similar situation. I have a SelectBox on the page, and then I open a lightbox with inline html and I call SelectBox only on content within the lightbox. When I close the lightbox the SelectBox on the page no longer works.

I've tried your suggestion but it doesn't seem to be working. Do you mean to unbind any events I have that call SelectBox or Completely Destroy them?

EDIT: I fixed my issue by being more specific with my selectors. When I was closing the lightbox, i was trying to clear all selectboxes and then create them again. After being more specific with all my selectors i just 'destroy'ed only the ones in the lightbox and all good now.

from jquery-selectbox.

dk103213 avatar dk103213 commented on August 16, 2024

Same, if you destroy just the ones you remove, it works. ew.

from jquery-selectbox.

Flyingmana avatar Flyingmana commented on August 16, 2024

comment out "if( select.data('selectBox-control') ) return false;" in init method helps and have no drastic side effects for usage at my projects. But have not looked, where this could make problems.

from jquery-selectbox.

draganHR avatar draganHR commented on August 16, 2024

Same problem,
confirming $('select').selectBox('destroy'); helps as workaround.

from jquery-selectbox.

claviska avatar claviska commented on August 16, 2024

This is because the settings are stored in the original SELECT element, so when you say $('SELECT').remove() you remove the native control without removing the UI control.

This is a tradeoff for using UI controls. jQuery UI's button control is a similar example: you need to use .button('disable') instead of .prop('disabled', true).

JavaScript can only be so powerful :P

from jquery-selectbox.

GuyMograbi avatar GuyMograbi commented on August 16, 2024

Great plugin!
debugging the code, I found that adding a simple null check solves the problem.
if ( typeof(settings) == "undefined") { return; } should be used twice. in "hideMenus" and "showMenus".
read more at my blog

from jquery-selectbox.

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.