PDA

View Full Version : why this is not working fine into the IE. but working fine into the mozilla.



himalpatel
4 Jun 2013, 7:37 AM
I have a button named, "Save Changes". I want to change its name when i click on that button and then an ajax call is executed. After that ajax call, I want to change that button name again.
For example.
Click on "Save Changes" -> button name is changed to "Saving" -> after the executed ajax call, again button name is changed with "Save Changes".

Here Somehow . this following statement, Ext.getCmp('btnSaveChanges').setText('Saving',true); , is not working into the IE. But it is working fine into the mozilla.

So please give me the some fix for this so that i can resolve this issue.

please see the below code.

function btnSaveChanges_Click() {
Ext.getCmp('btnSaveChanges').setText('Saving',true);
$.ajax({
type: "GET",
data: UpdateMetadata(),
contentType: 'json',
dataType : "Script",
async: false,
success: function (result) {
Ext.getCmp('btnSaveChanges').setText('Save Changes');
},
error: function (request) {
Ext.getCmp('btnSaveChanges').setText('Save Changes');
}
});
}


function UpdateMetadata() {


for(var i=0; i< 100000; i++);
return true;
}

glopes
4 Jun 2013, 7:56 AM
Change your button code to the following:



xtype: 'button',
handler: function(button, event) {
button.setText('Saving...');
$.ajax({
type : "GET",
data : UpdateMetadata(),
contentType : 'json',
dataType : "Script",
async : false,
callback: function(response) {
button.setText('Save Changes');
}
});
},
text: 'Save Changes'
}