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

Count Selected Text Attribute #46

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

slantz
Copy link

@slantz slantz commented Mar 5, 2015

Added trivial realization of 'count-selected-text' attribute to be shown, when selected-text-format presents.

@lordfriend
Copy link
Owner

Would you please show me a demo for this feature?
According to the document of Bootstrap-select . This feature is for define the format of displayed text for toggle button when selectedTextFormat attribute is count>x or count. But your commit seems simply add the count-selected-text attribute into the button.
This wouldn't help for format the text.

In fact, there are a way to customize the format for selected-text-format.
See http://nya.io/nya-bootstrap-select/#!/api/nya-bs-config-provider

@slantz
Copy link
Author

slantz commented Mar 7, 2015

When modifying the provider in config method, it'd be applied globally across all the nya-bs-select elements. But in some cases it may be required to set particularly text for each element while keeping all other to behave as expected.

As an example I don't need to now the number of selected elements, some custom text is required when all elements are selected, e.g.

<ol class="nya-bs-select" ng-model="selectedItem" count-selected-text="All Cool Things" data-selected-text-format="count>{{items.length-1}}" multiple>
<li nya-bs-option="item in items">
<a>{{item}}<span class="glyphicon glyphicon-ok check-mark"></span></a>
</li>

</ol>

@lordfriend
Copy link
Owner

I think use data-binding in select-text-format attribute will fail. Your `count>{{items.length-1}} won't work.

But your commit doesn't make the feature fully functional as it described in Bootstrap-select. It just provide a text for, and will confuse the user who ever used the Bootstrap-select.

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.

2 participants