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

'templates' option not working #20

Closed
rammoozz opened this issue Oct 9, 2015 · 3 comments
Closed

'templates' option not working #20

rammoozz opened this issue Oct 9, 2015 · 3 comments

Comments

@rammoozz
Copy link
Contributor

rammoozz commented Oct 9, 2015

Hello,

Adding the templates option seems to cause the multiselect not to render, is there something with my code or is the feature not included in the wrap?

templates= {function(){
    return({
           templates: {
                button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>',
                ul: '<ul class="multiselect-container dropdown-menu"></ul>',
                filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>',
                filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>',
                li: '<li><a href="javascript:void(0);"><label></label></a></li>',
                divider: '<li class="multiselect-item divider"></li>',
                liGroup: '<li class="multiselect-item group"><label class="multiselect-group"></label></li>'
            }
        });
    }}
@skratchdot
Copy link
Owner

Have you tried it without the nested 'templates' key? I also think you just need to pass an object, but I haven't tested this. Something like:

templates= {{
                button: '<button type="button" class="multiselect dropdown-toggle" data-toggle="dropdown"></button>',
                ul: '<ul class="multiselect-container dropdown-menu"></ul>',
                filter: '<li class="multiselect-item filter"><div class="input-group"><span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span><input class="form-control multiselect-search" type="text"></div></li>',
                filterClearBtn: '<span class="input-group-btn"><button class="btn btn-default multiselect-clear-filter" type="button"><i class="glyphicon glyphicon-remove-circle"></i></button></span>',
                li: '<li><a href="javascript:void(0);"><label></label></a></li>',
                divider: '<li class="multiselect-item divider"></li>',
                liGroup: '<li class="multiselect-item group"><label class="multiselect-group"></label></li>'
    }}

So a simplified version might be:

<MultiSelect templates={{li:'<li>neat<li>'}} />

Can you test this and let me know if it works? I might be able to look into it a bit later...

@skratchdot
Copy link
Owner

Forgot to mention that the templates option was supposed to be fixed in this commit: d49f078 related to #12

@rammoozz
Copy link
Contributor Author

👍 Thank you! Life Saver!

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

No branches or pull requests

2 participants