Created
February 27, 2013 18:50
-
-
Save sivagao/5050497 to your computer and use it in GitHub Desktop.
easy way to do operations on many items selected in a list in a similar manner to how the Mail app on iOS works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ext.application({ | |
| name: 'MyApp', | |
| requires: [ | |
| 'Ext.MessageBox' | |
| ], | |
| views: ['Main'], | |
| launch: function() { | |
| // Destroy the #appLoadingIndicator element | |
| Ext.fly('appLoadingIndicator').destroy(); | |
| // Initialize the main view | |
| Ext.Viewport.add(Ext.create('MyApp.view.Main')); | |
| }, | |
| onUpdated: function() { | |
| Ext.Msg.confirm( | |
| "Application Update", | |
| "This application has just successfully been updated to the latest version. Reload now?", | |
| function(buttonId) { | |
| if (buttonId === 'yes') { | |
| window.location.reload(); | |
| } | |
| } | |
| ); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Ext.define('MyApp.view.Main', { | |
| extend: 'Ext.tab.Panel', | |
| xtype: 'main', | |
| requires: [ | |
| 'Ext.TitleBar', | |
| 'Ext.Video', | |
| 'Ext.List', | |
| 'Ext.data.Store', | |
| 'Ext.ux.plugin.ListActions', | |
| ], | |
| config: { | |
| tabBarPosition: 'bottom', | |
| items: [{ | |
| xtype: 'list', | |
| title: 'Welcome', | |
| iconCls: 'home', | |
| styleHtmlContent: true, | |
| scrollable: true, | |
| items: { | |
| docked: 'top', | |
| xtype: 'titlebar', | |
| title: 'Welcome to Sencha Touch 2', | |
| items: [{ | |
| xtype: 'button', | |
| name: 'listactions' | |
| }] | |
| }, | |
| itemTpl: '{name}', | |
| plugins: [{ | |
| xclass: 'Ext.ux.plugin.ListActions', | |
| actionsToolbar: { | |
| items: [{ | |
| text: 'Delete (0)', | |
| ui: 'decline', | |
| eventName: 'delete' | |
| },{ | |
| text: 'Move (0)', | |
| eventName: 'move' | |
| },{ | |
| text: 'Mark (0)', | |
| eventName: 'mark' | |
| }] | |
| }, | |
| actionToggleButton: { | |
| selector: function(list) { | |
| return list.down('button[name="listactions"]'); | |
| }, | |
| enableText: 'select', | |
| disableText: 'cancel' | |
| } | |
| }], | |
| data: [{ | |
| name: 'Joe' | |
| },{ | |
| name: 'Bob' | |
| },{ | |
| name: 'Megan' | |
| },{ | |
| name: 'Susan' | |
| }] | |
| }] | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment