]>
Commit | Line | Data |
---|---|---|
6527f429 DM |
1 | /**\r |
2 | * {@link Ext.ActionSheet ActionSheets} are used to display a list of {@link Ext.Button buttons} in a popup dialog.\r | |
3 | *\r | |
4 | * The key difference between ActionSheet and {@link Ext.Sheet} is that ActionSheets are docked at the bottom of the\r | |
5 | * screen, and the {@link #defaultType} is set to {@link Ext.Button button}.\r | |
6 | *\r | |
7 | * ## Example\r | |
8 | *\r | |
9 | * @example preview miniphone\r | |
10 | * var actionSheet = Ext.create('Ext.ActionSheet', {\r | |
11 | * items: [\r | |
12 | * {\r | |
13 | * text: 'Delete draft',\r | |
14 | * ui : 'decline'\r | |
15 | * },\r | |
16 | * {\r | |
17 | * text: 'Save draft'\r | |
18 | * },\r | |
19 | * {\r | |
20 | * text: 'Cancel',\r | |
21 | * ui : 'confirm'\r | |
22 | * }\r | |
23 | * ]\r | |
24 | * });\r | |
25 | *\r | |
26 | * Ext.Viewport.add(actionSheet);\r | |
27 | * actionSheet.show();\r | |
28 | *\r | |
29 | * As you can see from the code above, you no longer have to specify a `xtype` when creating buttons within a {@link Ext.ActionSheet ActionSheet},\r | |
30 | * because the {@link #defaultType} is set to {@link Ext.Button button}.\r | |
31 | *\r | |
32 | */\r | |
33 | Ext.define('Ext.ActionSheet', {\r | |
34 | extend: 'Ext.Sheet',\r | |
35 | alias : 'widget.actionsheet',\r | |
36 | requires: ['Ext.Button'],\r | |
37 | \r | |
38 | config: {\r | |
39 | /**\r | |
40 | * @cfg\r | |
41 | * @inheritdoc\r | |
42 | */\r | |
43 | baseCls: Ext.baseCSSPrefix + 'sheet-action',\r | |
44 | \r | |
45 | /**\r | |
46 | * @cfg\r | |
47 | * @inheritdoc\r | |
48 | */\r | |
49 | left: 0,\r | |
50 | \r | |
51 | /**\r | |
52 | * @cfg\r | |
53 | * @inheritdoc\r | |
54 | */\r | |
55 | right: 0,\r | |
56 | \r | |
57 | /**\r | |
58 | * @cfg\r | |
59 | * @inheritdoc\r | |
60 | */\r | |
61 | bottom: 0,\r | |
62 | \r | |
63 | // @hide\r | |
64 | centered: false,\r | |
65 | \r | |
66 | /**\r | |
67 | * @cfg\r | |
68 | * @inheritdoc\r | |
69 | */\r | |
70 | height: 'auto',\r | |
71 | \r | |
72 | /**\r | |
73 | * @cfg\r | |
74 | * @inheritdoc\r | |
75 | */\r | |
76 | defaultType: 'button'\r | |
77 | }\r | |
78 | });\r |