ghiscoding / Angular-Slickgrid

Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
https://ghiscoding.github.io/Angular-Slickgrid
Other
397 stars 120 forks source link

Multiselect options "items selected" #523

Closed meta-akshita-agrawal closed 4 years ago

meta-akshita-agrawal commented 4 years ago

Hey, @ghiscoding I guess this is not an issue but I was not sure where to put this. I just wanted to know if there is any property that can change the text of a multiselect column filter for 4 of 10 items selected to just 4 items selected. I looked into multipleSelectOption.interface.d.ts but didn't find any such property. Can I do some workaround to do this?

General Topic

Your Environment

Software Version(s)
Angular x.y
Angular-Slickgrid x.y
TypeScript x.y
Operating System x.y
NPM/Node/Yarn x.y

Context or Topic

Expected Behavior

Current Behavior

Possible Solution

ghiscoding commented 4 years ago

The lib uses a customize of a 3rd party lib called multiple-select (you can see their examples), and I say customized because you see here the version I use, because I added a few specific functionalities that weren't in the original lib but technically all of the docs are defined in the original multiple-select lib. Since that lib was a jQuery (JS) lib, I manually added an TypeScript interface for it models/multipleSelectOption.interface.ts and you can use it with filterOptions: { /*...*/ } as MultipleSelectionOption and there's an example here... So to come back to your question, the flag that produces the text you wrote is countSelected which by default is set in that 3rd party lib to countSelected: '# of % selected', but what is probably better is to change the minimumcountselected flag (which is set to 3 by default).

There's also more info in the Wiki - Select Filter, I suggest you read it quickly.

I would still prefer that you ask such kind of question on Stack Overflow and preferably keep only lib issues as issues. Anyone can answer on Stack Overflow though I do check once in a while, since anyone can answer there it helps me having to answer too many of these questions. Thanks and please upvote if you haven't already ⭐

meta-akshita-agrawal commented 4 years ago

You just saved my day :) I already have read this property but didn't understand the purpose of it. So what I just did is countSelected: '# items selected' and it served my purpose. Thanks :)