PDA

View Full Version : Get button object



nityajs
26 Aug 2009, 4:02 AM
Hi All,

This question might be quiet silly but I am trying to get an button object and do submit when user clicks yes on the message confirm box. Here is the sample code. I gave id to my button as id:"save"

Ext.MessageBox.confirm('Confirm','Do you want to exit without saving data? Yes or No',
function( btn ) {
if ( btn == 'yes' ) {

//call save button submit
alert(Ext.getCmp('save'));
} else {
return false ;
}
}
);


Please help me in getting the object of save button so that I can submit the form when YEs is clicked on Message confirm.

Any hint would be highly appreciated.

Animal
26 Aug 2009, 4:39 AM
It's passed to the Button's handler function.

As fully explained when you read the API docs for what you are doing:

http://extjs.com/deploy/ext-3.0.0/docs/?class=Ext.Button&member=handler