meteor-autocomplete icon indicating copy to clipboard operation
meteor-autocomplete copied to clipboard

Use different value for saving vs display

Open keiranvv opened this issue 10 years ago • 3 comments

Hi

Is there a way to use the _id field of a document for saving to a collection but for searching and displaying, using a different field?

keiranvv avatar Sep 14 '15 16:09 keiranvv

I'd love to have an answer to this question too :)

a-becker42 avatar Sep 21 '15 16:09 a-becker42

Maybe you guys just want to use the field in the settings, and event triggers to get the _id of whatever document is being selected, and just save that?

mizzao avatar Sep 21 '15 18:09 mizzao

I'm assuming the event you have in mind is autocompleteselect, as described in the documentation. Am I right?

The example code is:

Template.foo.events({
  "autocompleteselect input": function(event, template, doc) {
    console.log("selected ", doc);
  }
});

a-becker42 avatar Sep 22 '15 12:09 a-becker42