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

Some Examples Of Useage #1

Open
asafshen opened this issue Mar 2, 2016 · 2 comments
Open

Some Examples Of Useage #1

asafshen opened this issue Mar 2, 2016 · 2 comments

Comments

@asafshen
Copy link

asafshen commented Mar 2, 2016

Hi,

Can you please give some example of usage?
maybe a complimentary js file with the example of:
{{#Multiselect name='myMultiselect' options=myOptions selected=selectedOptions }} <option value="{{ _id }}" {{ attrs }}>{{ caption }}</option> {{/Multiselect}}
myOptions and selectedOptions definitions..?

Thanks ahead.

@brucejo75
Copy link

brucejo75 commented May 24, 2016

Hi @asafshen,

I had the same frustration. I compared emdagon version to JSSolutions. They both had things I liked so I combined their features and created this: https://github.com/brucejo75/meteor-bootstrap-multiselect. You can find it on atmosphere here.

I am hoping it is more approachable for beginners (like me) and it has more features (being able to set config options) which can make it more useful.

Take a look and let me know what you think! Any/all feedback welcome.

@ArthurGerbelot
Copy link

ArthurGerbelot commented Sep 11, 2017

Based on this file Multiselect Template Js file on Github the options and selected have to be:

Template.myTmpl.helpers({
  myOptions() { 
    return [
      {_id: 'item-a', caption: 'Item A'},
      {_id: 'item-b', caption: 'Item B'},
      {_id: 'item-c', caption: 'Item C'},
    ]
  },
  selectedOptions() {
    return [ 'item-a', 'item-b' ]
  }
})

You can change the caption key by whatever you want (or add multiple keys) but you have to update the HTML part

Warning The selected options are based the _id so you can't update this one.

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

3 participants