brucejo75 / meteor-bootstrap-multiselect-sample

Sample code for the meteor-bootstrap-multiselect package
MIT License
1 stars 0 forks source link

Extracting the values #1

Open Zorrow2008 opened 7 years ago

Zorrow2008 commented 7 years ago

Hello,

Once I select the different options, how would I be able to get those choices in the manager and put them into a collection?

Thanks for the package!

brucejo75 commented 7 years ago

Hello @Zorrow2008,

Check out this line:. That is where the arr variable is updated. Explanation:

  1. The config options allow you to set up an onChange event. Each time any parameter changes in the multi-select the onChange event will fire.
  2. When it fires I set one of the arr values corresponding to the element that changed. Set a breakpoint on that line and take a look around when you are running it.
  3. Instead of the arr variable go ahead and do whatever you want, e.g. make a collection call to set a document or call a method to send the data to the server and load it into your collection.