okfn/ckan — pull request #508 by johnmartin (2013-02-28 13:29:42+00:00)
Title: #498 Allows you to attach a group to a existing dataset

__Part 1: 30c87e4__

Essentially the fix is to add `data-module-key` and `data-module-label` to the auto complete JS module. Which then gets passed down into the parser to map `key/value` pairs to what the input value will become as well as what get's display within the dropdown.

Example JSON AJAX response:

[
{ "a": 1, "b": 2, "c": 3 },
{ "a": 4, "b": 5, "c": 6 }
]

So, let's say the input needs to have `a` as a value but wants to use `c` as a label within the dropdown.

Therefore: `data-module-key="a" data-module-value="c"`

__Part 2: 56fd969__

This one just adds the `data-module-*` to the template and changes the input field to be the correct `__id` and not `__name`