Clear results

1 view
Skip to first unread message

bronson

unread,
Jul 3, 2008, 8:00:42 AM7/3/08
to Google AJAX API
Hi every body,

I've tried for a while to set up a customerized clearresults button
within the search control box.

I couldn't fix it

I've tried various pieces of code but none worked out

last (and least...) i tried this, loaded at page loading :
RawSearchControl.prototype.clearResults = function() {
removeChildren(this.results);
document.getElementById('Restriction').style.display = 'block';
}
My target is to clear the results, hide the afferent div and show the
"Restriction" div

The link to page http://jeanroubaud.free.fr/Compario/ClearResult.html

Any help would be appreciated

Rgds

Vision Jinx

unread,
Jul 3, 2008, 12:54:32 PM7/3/08
to Google AJAX API
Hi,

I have a few examples of doing that in my app. The function your
probably looking for is what I have as "cse.prototype.onClear" (I have
mine integrated with the CSE results also)

Except on my homepage that is not the function firing anymore since I
updated it to include the feed search and reading aspects to it so if
you wanted to see it "In action" check out the one on my blog (2nd
link) as that uses my old version (when you click the x beside the
search box, the "clear results" link by the search results does it a
different way) and I haven't updated those yet.

My homepage is using a custom search form
http://www.visionjinx.net/

My blog is using the Google form
http://www.visionjinx.net/gadgets/

Just view source on my homepage and you should see how I have mine
working.

Hope that helps :-)

Cheers!
Vision Jinx


On Jul 3, 6:00 am, bronson <jean.roub...@gmail.com> wrote:
> Hi every body,
>
> I've tried for a while to set up a customerized clearresults button
> within the search control box.
>
> I couldn't fix it
>
> I've tried various pieces of code but none worked out
>
> last (and least...) i tried this, loaded at page loading :
> RawSearchControl.prototype.clearResults = function() {
> removeChildren(this.results);
> document.getElementById('Restriction').style.display = 'block';
> }
> My target is to clear the results, hide the afferent div and show the
> "Restriction" div
>
> The link to pagehttp://jeanroubaud.free.fr/Compario/ClearResult.html

jgeerdes [AJAX APIs "Guru"]

unread,
Jul 3, 2008, 5:20:36 PM7/3/08
to Google AJAX API
Without intending to offend or condescend, it looks to me that you're
trying to combine two or three different example scripts without
really understanding what the code is doing. Might I recommend a
Javascript tutorial?

Beyond that, you need to initialize your custom SearchForm AFTER you
draw your SearchControl, and you have to tie the custom form to the
control using the form's setOnSubmitCallback and setOnClearCallback.
The link below should serve to demonstrate what I'm talking about:

http://jgeerdes.home.mchsi.com/playground/bronson.html

Jeremy R. Geerdes
Effective website design & development
Des Moines, IA

For more information or a project quote:
http://jgeerdes.home.mchsi.com
jgee...@mchsi.com

If you're in the Des Moines, IA, area, check out Debra Heights
Wesleyan Church!

bronson

unread,
Jul 4, 2008, 12:16:28 PM7/4/08
to Google AJAX API
Hi jeremy,

Many thanks but feel free to say what you feel.
As a matter of fact i'm in great difficulties with those API's. To be
told that don't know wahat i'm doing, there no hurt on my side. That
the very truth, nothing else. So again feel free.

Be granted for your patience with this 2 left hands man.

You catching up exactly what i'm doing : snooring around the bone
copying and pasting pieces of code found on the Web without guidance
really.
And when i desperate i post an SOS on that forum

Again many thanks from Paris - France

Your example is perfectly working and that eaxctly what i was looking
after.

On 3 juil, 23:20, "jgeerdes [AJAX APIs \"Guru\"]" <jgeer...@mchsi.com>
wrote:
> Without intending to offend or condescend, it looks to me that you're
> trying to combine two or three different example scripts without
> really understanding what the code is doing.  Might I recommend a
> Javascript tutorial?
>
> Beyond that, you need to initialize your custom SearchForm AFTER you
> draw your SearchControl, and you have to tie the custom form to the
> control using the form's setOnSubmitCallback and setOnClearCallback.
> The link below should serve to demonstrate what I'm talking about:
>
> http://jgeerdes.home.mchsi.com/playground/bronson.html
>
> Jeremy R. Geerdes
> Effective website design & development
> Des Moines, IA
>
> For more information or a project quote:http://jgeerdes.home.mchsi.com
> jgeer...@mchsi.com

jgeerdes [AJAX APIs "Guru"]

unread,
Jul 4, 2008, 2:22:21 PM7/4/08
to Google AJAX API
No problem. I completely understand where you're coming from; I was
there not long ago!

jg
Reply all
Reply to author
Forward
0 new messages