Skip to content

Nested array as data source for autoComplete #57

@Driaan

Description

@Driaan

Hi ladies and gents,

This is my situation:
var choices = ['ActionScript', 'AppleScript', 'Asp'];
Above is my data object for autoComplete suggestions, however, I wanted to be able to nest more data within those items (in my case to prevent a second request after selecting an item), so that as soon as the user selects the item, there is already some data to display.
So basically, I would like to render it as such:
return '<div data-json="' + item.data + '" data-text="' + item + '"></div>'
where as my data source would look something like json:
var choices = [{name: 'foo', data 'bar'}, 'AppleScript', 'Asp'];
Thus once selected, in the callback I am able to get the dataAttribute('data-json'), and render a different list without having to wait for another request to the server.

If anyone has any advice, it is greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions