ktoole
12-06-2010, 09:23 AM
I have a button defined for saving the data. It fires when the page is being rendered. I have another button setup for canceling the edit and it does not fire. Both are setup to fire on "click". Can you tell me what I am missing? The save button also generates an error when clicked on.
Listeners for the buttons:
selectionWindow = Ext.extend(selectionWindowUi, {
initComponent: function() {
selectionWindow.superclass.initComponent.call(this );
this.btnSave.disabled = true;
this.btnSave.on('click',this.onBtnSaveClick(),this );
this.btnCancel.on('click',this.onBtnCancelClick,th is);
Abreviated code for the button functions. When I click on the Save button, it never gets to this code. When I first call the window, the onBtnSaveClick function is called.
onBtnCancelClick: function(){
this.hide();
this.destroy();
},
onBtnSaveClick: function(){
// this calls the RPG routine to save the data here.
if (this.isVisible()) {
Ext.Ajax.request({
url: 'vvcall.pgm',
Code for the Buttons:
MyToolbarUi = Ext.extend(Ext.Toolbar, {
height: 35,
width: 933,
flex: 1,
initComponent: function() {
this.items = [
{
xtype: 'button',
text: 'Save',
icon: '/vvresources/icons/save.gif',
ref: 'btnSave',
id: 'btnSave'
},
{
xtype: 'tbseparator'
},
{
xtype: 'button',
text: 'Cancel',
icon: '/vvresources/icons/cancel.png',
ref: 'btnCancel',
id: 'btnCancel'
}
];
MyToolbarUi.superclass.initComponent.call(this);
}
});
Listeners for the buttons:
selectionWindow = Ext.extend(selectionWindowUi, {
initComponent: function() {
selectionWindow.superclass.initComponent.call(this );
this.btnSave.disabled = true;
this.btnSave.on('click',this.onBtnSaveClick(),this );
this.btnCancel.on('click',this.onBtnCancelClick,th is);
Abreviated code for the button functions. When I click on the Save button, it never gets to this code. When I first call the window, the onBtnSaveClick function is called.
onBtnCancelClick: function(){
this.hide();
this.destroy();
},
onBtnSaveClick: function(){
// this calls the RPG routine to save the data here.
if (this.isVisible()) {
Ext.Ajax.request({
url: 'vvcall.pgm',
Code for the Buttons:
MyToolbarUi = Ext.extend(Ext.Toolbar, {
height: 35,
width: 933,
flex: 1,
initComponent: function() {
this.items = [
{
xtype: 'button',
text: 'Save',
icon: '/vvresources/icons/save.gif',
ref: 'btnSave',
id: 'btnSave'
},
{
xtype: 'tbseparator'
},
{
xtype: 'button',
text: 'Cancel',
icon: '/vvresources/icons/cancel.png',
ref: 'btnCancel',
id: 'btnCancel'
}
];
MyToolbarUi.superclass.initComponent.call(this);
}
});