@Jeremy:

IIUC, the CustomSearchControl is still supported, as it remains
fundamental to the current Custom Search Element JS API.  Here's some
current documentation:

http://code.google.com/apis/customsearch/docs/js/cselement-devguide.html

http://code.google.com/apis/customsearch/docs/js/cselement-reference.html

But see notes below regarding setSearchCompleteCallback.


__________________________________________________


@yotam:

Currently, IIUC, you can obtain the "searcher" as the 2nd argument to
the callback function that you assign via setSearchCompleteCallback or
setSearchStartingCallback.

NOTE:  Usage shown below is NOT consistent with the CS Element JS
Reference's current description of setSearchCompleteCallback.  (I
suspect perhaps that documentation may be in error?)  Nonetheless, the
usage shown below still works for me at this time.

If you use setSearchCompleteCallback (on a CustomSearchControl) as
shown here, the search-completion callback function takes two
arguments: the search-control and the searcher.

  customSearchControl.setSearchCompleteCallback(
    this,
    function(control, searcher) {
      // ... etc. ...
    });

If you use setSearchStartingCallback, the search-starting callback
function takes 3 arguments: the search-control, the searcher, and the
query string.

  customSearchControl.setSearchStartingCallback(
    this,
    function(control, searcher, query) {
      // ... etc. ...
    });


NOTES:

The current CS Element JS Reference (2nd link above) documents the
setSearchStartingCallback and setSearchCompleteCallback methods.  As I
mentioned, the usage that I've shown above is NOT consistent with the
CS Element JS Reference's current description of
setSearchCompleteCallback (I suspect a documentation error).

I don't know if the CS Element's implementation of those arguments may
be expected to change in the future (could someone from Google comment
on that)?

YMMV.

-- omr

-- 
You received this message because you are subscribed to the Google
Groups "Google AJAX APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
To view this message on the web, visit
http://groups.google.com/group/google-ajax-search-api?hl=en_US
For more options, visit this group at
http://groups.google.com/group/google-ajax-search-api?hl=en?hl=en

Reply via email to