Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[proposal] Expose $container to the selectAll/deSelectAll callbacks #846

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ghost
Copy link

@ghost ghost commented Dec 13, 2016

The idea is to be able to do stuff on children of the container in the callback.

NB: I wasn't able to run the tests locally (I don't know how)

@davidstutz
Copy link
Owner

Not sure about the use case here ...

@ghost
Copy link
Author

ghost commented Dec 12, 2017

Will update tomorrow (GMT+2) with details on the use case. Thanks.

@ghost
Copy link
Author

ghost commented Dec 13, 2017

We use some custom icons for everything including checkboxes and radios. In order to style the checkboxes/radios in the multiselect I need the container to do:

onInitialized: function(select, container) {
    // caret icon
    $(container).find(".caret").removeClass("caret").addClass("xxxx-angle-down");

    // custom checkboxes
    $(container).find(".checkbox").addClass("xxxx-checkbox");

    // custom radios
    $(container).find(".radio").addClass("xxxx-radio");
},
onDropdownShow: function(event) {
    // reset
    $(event.currentTarget).find("li").find(".xxxx-checkbox,.xxxx-radio").removeClass("checked");

    // add checked class
    $(event.currentTarget).find("li.active").find(".xxxx-checkbox,.xxx-radio").addClass("checked");
},
onSelectAll: function(container, checked) {
    // reset
    $(container).find("li").find(".xxxx-checkbox,.xxxx-radio").removeClass("checked");

    // add checked class
    $(container).find("li.active").find(".xxxx-checkbox,.xxxx-radio").addClass("checked");
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant