View Full Version : How does Ext.Msg.prompt work?

27 Dec 2011, 11:13 PM
I'm trying to create a modal message box for input password. Here is the code:

Ext.Msg.prompt("Password","Please input your password?", function (btn, text) {
if (btn == "ok" && text == mypassword )
valid = true;

There are two problems:

1. I can't input anything at all. When I move cursor to textbox, no matter what I key, it always has no response.
2. The prompt will return immediately instead of waiting for my callback function return

Any suggestions? Thanks

28 Dec 2011, 8:02 AM
Ext.Msg is an instance of Ext.MessageBox which is an Ext.Panel that is floating. All of the methods (confirm, alert, prompt) will just reconfigure the Ext.Msg instance. This doesn't fit all situations and it's not that configurable. Some times it's better to create your own floating panel.

28 Dec 2011, 8:07 AM
So in general, it's not usable?

I've tried Ext.Msg.prompt in 2.0, at least I can input something. Then what's your suggestion to create a modal messagebox? ( I'm very new to Sencha Touch, it's quite difficult to pass data between different view - I'm using MVC)

28 Dec 2011, 8:08 AM
It's usable but has limitations... like the size doesn't update and it's not configurable.