Tutorials Sencha Touch Confirm, Alert and Prompt MessageBox in Sencha Touch

Confirm, Alert and Prompt MessageBox in Sencha Touch

Sheet is a floating model panel widget, what animates on top of the view. Below image shows the class diagram of Ext.Sheet class. Sheet is subclass of Panel, which extends the functionality and provides flexibility to developer to add stack of other widgets to it. It is orientation aware; flipping the device causes the sheet to render in landscape mode. Sheet is a generic class for ActionSheet, Picker and MessageBox.

Sencha Sheet in class diagram

MessageBox widget is derived from Ext.Sheet class and allows the alert like functionality, with sencha default styles. MessageBox widget provides alert like functionality, with Sencha theming. There are three most commonly used MessageBox available in sencha touch, alert, confirm and prompt. Alert is used to display some information with one button. Confirm message allows user to take decision ‘yes’ or ‘no’ to execute set of functionality. And, prompt is used for allow user input data and process the result using a callback function.

Below example shows the usage of different MessageBox in action

// For Alert type MessageBox
Ext.Msg.alert('Alert', 'Sencha Touch is Sexy ! Isn\'t it ?', Ext.emptyFn);

// For Confirm type MessageBox
Ext.Msg.prompt('Confirm', 'Please enter your name', function(text) {
     // text represents the user input value				
});

// For Alert type MessageBox
Ext.Msg.confirm("Confirmation", "Are you sure you want to exit?", Ext.emptyFn);

Below is the output of the above code.
Confirm, Alert and Prompt MessageBox in Sencha Touch

Total
0
Shares
Previous Post
Sencha Touch Tutorials

Sencha Touch ToolBar example

Next Post
Sencha Touch Tutorials

Sencha Touch Sheet And ActionSheet Example

Related Posts
By clicking “Allow All”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. Cookie Notice
Allow All