Meteor-Community-Packages / meteor-autocomplete

Client/server autocompletion designed for Meteor's collections and reactivity.
https://atmospherejs.com/mizzao/autocomplete
MIT License
350 stars 109 forks source link

search in nested array field #145

Open ApayRus opened 6 years ago

ApayRus commented 6 years ago

Thanks for great plugin! I'm trying to use it in dictionary, to point at the root of word. But list of 5 limited selections looks empty. But in console event return some relevant word object, searched through template subscription (not all collection)... Why list of autocomplete items looks empty? Article collection document looks like { words: [{note, word}], translations: [ ] } Honestrly, I don't know, what should I write in Template.rootAutocomplete .

  rootAutocompleteSettings() {
    return {
      position: "top",
      limit: 5,
      rules: [
        {
          collection: Articles,
          field: "words.word",
          template: Template.rootAutocomplete
        }
      ]
    };
  }
{{> inputAutocomplete settings=rootAutocompleteSettings id="msg" class="input-xlarge" placeholder="root"}}
<template name="rootAutocomplete">
    {{words.word}}
</template>

peek 2017-12-14 14-58

rogerkirkness commented 5 years ago

I'm wondering the same. I haven't been able to figure it out so far.