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

Starting point for implementation of key field #77

Closed dovrosenberg closed 9 years ago

dovrosenberg commented 9 years ago

I post this not as a proposed robust solution, but rather as a starting point for further work. I've implemented a simple version of a "key" field in the autocomplete.

What it does:

Where it falls down (among other places, I'm sure):

Just figured I'd share since I made it this far...

mizzao commented 9 years ago

I don't quite understand what the key field is supposed to be doing, but can you first make sure the code builds first? The Travis CI build seems to fail in the coffeescript compile step.

dovrosenberg commented 9 years ago

Sorry - a versioning issue. Now builds.

The idea is that many times when you're doing a lookup you are going to connect the record selected to another one via a foreign key sort of relationship. So, this enables you to 1) easily get the foreign key for the item selected in the autocomplete and 2) prepopulate the autocomplete for a specified key value (useful when editing a record with an existing value).

mizzao commented 9 years ago

I still don't understand the idea behind the key. Maybe you can provide an example app that uses this idea?

However, I do agree you should not edit code with tabs instead of spaces. Spaces are pretty much standard in web development now.

dovrosenberg commented 9 years ago

I'll I'll keep working on trying to get it to build. It's working fine locally, so I'm not sure what's going on...

Will work on a quick sample as well, to try to better explain.