PDA

View Full Version : Button - Newb question



finco
5 Apr 2007, 7:49 AM
I want to put a button on a form that passes the form values to a function when pressed. I have put the following code on the Ext.onReady event but it triggers the button when the page loads. Can someone please tell me how this should be handled? Also, I seem to be lost in the documentation - where can I find doc. on the widgets (i.e. button etc)?

Here's the code I am using:

var btnSearch = new Ext.Button('btnSearch',
{text: 'Search',
handler: DoSearch(this.value),
});

tryanDLS
5 Apr 2007, 8:01 AM
Documentation is here http://extjs.com/deploy/ext/docs/ or in the download.
Not everything is documented yet, however Button is.

DoSearch(this.value) is called immediately, rather than when the button is clicked - it's a function call, instead of passing a function ref as the handler property.

finco
5 Apr 2007, 8:24 AM
Thanks for the response - I'm sorry to ask but can you show haow the handler should be structured? Thanks very much.