Hi Jim,

I recently worked on a sample where we used
control.setSearchCompleteCallback to add a small x to clear the results by
adding new nodes to the DOM after the searches are completed. You can see
the code here

http://en.wikipedia.org/w/index.php?title=User:Jscud/vector.js&action=raw&ctype=text/javascript&dontcountme=s

(We talked about it in greater detail in this blog post:
http://googlecustomsearch.blogspot.com/2009/10/contextual-search-experience-for.html)

There is more than one way to do this, but would the above example work for
what you are trying to do?

Thank you,

Jeff



On Thu, Oct 22, 2009 at 8:48 PM, Jim <[email protected]> wrote:

>
> Hi,
>
> Recently, I added google custom search to my site.
> However it does not show a clear button in the results.
> Was wondering if there is a draw option for this.
>
> If you go to this blog
> http://googlecustomsearch.blogspot.com/
> The search for the blog itself has a clear button(a small "x") in the
> results.
> However the developer has used google search widget. Not custom
> search.
> I would like a similar "clear button 'x'" to be drawn in my results.
> Could not find a draw option for this.
>
> The link below has the same features as my search(It is not my site):
> http://ajax-apis.appspot.com/cse-less-style
>
> function triggerGoogleSearch()
> My code:
> {
>        google.load('search', '1');
> //Google Branding
> google.search.Search.getBranding(document.getElementById("branding"));
>   // Create a Custom Search control that uses a CSE restricted to
> code.google.com
>   // Change the customSearchId string to the ID of your own Custom
> Search engine.
>   var customSearchControl = new google.search.CustomSearchControl
> ('xxxx');
>   //open search links clicked in same window
>   customSearchControl.setLinkTarget
> (google.search.Search.LINK_TARGET_SELF);
>   //Set drawing options to use my text box as input instead of having
> the library create one.
>   var drawOptions = new google.search.DrawOptions();
>   drawOptions.setInput(document.getElementById('query_input'));
>   //Draw the control in content div
>   customSearchControl.draw('results', drawOptions);
>   google.setOnLoadCallback(onLoad);
> }
>
> Thanks, Its probably something small, but has been bugging me for a
> while, don't want to upload the search feature to my site without it
> having
> the clear search button.
>
> Appreciate any help!
>
> Regards,
> Jim.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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]
For more options, visit this group at 
http://groups.google.com/group/google-ajax-search-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to