PDA

View Full Version : Display Message on Toolbar



haden
16 May 2011, 2:42 PM
I'm trying to use a button on my bottom toolbar to show a status message. I can alert the status_disp.text value, but when I try to set it, I get a 'status_disp.text.setValue is not a function' error.

I read that after rendering the bbar is not available and that one should use getBottomToolbar (http://dev.sencha.com/deploy/ext-3.3.1/docs/output/Ext.Panel.html#Ext.Panel-getBottomToolbar).
How can I set my stat_msg text?



bbar: [{
xtype: 'tbbutton', text:'Save',
handler: function(){
Order.getForm().submit({
success: function(form, action){
var status_disp = Ext.getCmp("stat_msg");
Ext.Msg.alert(status_disp.text, action.result.msg);
status_disp.text.setValue(action.result.msg);
},
failure: function(form, action){
// responses to errors
}
});
}
},{ xtype: 'tbbutton',
id: 'stat_msg',
text: 'hello',
}],
});
Order.render(document.body);
});
</script>

friend
17 May 2011, 4:47 AM
To change a button's text:


status_disp.setText(action.result.msg);

haden
17 May 2011, 6:46 AM
I was looking for the syntax for setting the text property - status_disp.text.setValue() - when there's a method for doing it. I feel a bit foolish. Oh well, I'm learning.

Thanks friend.