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

Passing Ids as well as getting Ids #39

Open
ghost opened this issue Apr 17, 2014 · 1 comment
Open

Passing Ids as well as getting Ids #39

ghost opened this issue Apr 17, 2014 · 1 comment

Comments

@ghost
Copy link

ghost commented Apr 17, 2014

Hi,

I was wondering if this library supports the ability to pass Ids to each tag as well as getting those passed Ids from the getTags function?

Estentially, what I want to do is pass the tags names and ids for the tags in the initialization. (e.g. $('#tags').tags({suggesstions: [ 'All', 'Accounting', 'Management' ], restrictTo: [ 'All', 'Accounting', 'Management' ], tagIds: [ '1', '2', '3' ] });)

And then would it be possible, using the getTags() function or another function (e.g. getTagIds()), to retrieve those ids as well as the tag names.

This would be very helpful if you could provide a solution for this to me. I would very much like to use this library, but I need it to support Ids.

Thanks!

~ Tyler

@maxwells
Copy link
Owner

Hi Tyler --

I've thought about this before. I'm hesitant to try and fit that in to the existing code base (it's due for a significant refactor/rewrite). It raises questions for me about how it would support adding new tags (versus just managing existing ones) -- how would it find the id value for a not previously existent tag? I've considered having the library support RESTful conventions for tag saving/loading (when provided a route prefix), but I'm not sold on the idea.

For the time being, could you do something like:

http://jsfiddle.net/FFe2M/1/ (see the bottom of the js portion)

Where you use a tag -> id mapping?

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

1 participant