I have a list of buildings I want people to be able to search for, and inside those buildings are an undetermined number of offices, perhaps none. My project is XML based and I'm pulling the buildings into an array as my source for jQuery autocomplete.
I have no problem getting a simple building search to work, the wrinkle is searching for offices as the goal is for only buildings to be returned. If you search for Office1, and Office1 is within Building1, then Building1 should be returned. Both Office1 and Building1 should show up in autocomplete.
I've tried two dimensional arrays like
var items = [[building,office,office],[building],[building, office]];
And I've also explored objects (use a array of objects as source for jQuery UI AutoComplete), thinking multiple offices could be associated with one building "label" within autocomplete but nothing quite seems to work in implementation.