jQuery AJAX autocomplete with view JSON?

Does anyone have any experience using a jQuery autocompleter pulling data from a Domino view using the ?readviewentries&outputformat=JSON querystring? Should be straightforward, but the JSON parsing for Domino’s deeply nested object model is tricky. Any help/suggestions are appreciated.

Subject: got it!

Mucking around with how jQuery expects JSON to be formatted and doing my Google research I finally found the answer. for jQuery autocomplete you need to override the default data parser to tease out the key value pairs from the verbose Domino JSON object using the undocumented “parse” parameter of autocomplete. Use parse to specify a function that reads the JSON data and extracts an array of key value pairs. Then use the (documented) format parameter of jQuery to return the individual item. I now have a reasonably succint jQuery autocompleter.

hat tip vezult on stackoverflow: javascript - What does formatResult and formatItem options do in JQuery Autocomplete? - Stack Overflow

UPDATE: code here: QUICK 'N EASY AJAX DOMINO NAME LOOKUP | Critical Masses Technology, Inc.

Subject: Not sure about JQuery…

But I just did this with YUI’s AutoComplete using a Domino/JSON view.

Here is my YUI data source which points at a regular Domino view. I was unable to point at view columns by ID, but did have success getting content by column number.

var myDataSource = new YAHOO.util.XHRDataSource(“/database.nsf/pluJSON!readviewentries&outputFormat=JSON”);

myDataSource.responseType = YAHOO.util.XHRDataSource.TYPE_JSON;

myDataSource.responseSchema = {

resultsList : "viewentry",

fields: [

  "entrydata[0].text[0]",

  "entrydata[1].text[0]",

  "entrydata[2].text[0]"

]	

};

Subject: YUI vs. jQuery

Thanks, but I really wanted to use the more succint jQuery toolkit.

Subject: jQuery vs. YUI

Jake, out of curiousity because I’m new to these libraries/toolkits. Why do you prefer jQuery over YUI? Personal preference?

Subject: personal pref

short answer, yes.

Long answer, I find jQuery to be more concise, which the minimalist in me likes. YUI has very slick widgets, though. Also, I do a lot of Drupal (CMS) work and jQuery is very wired into Drupal.