5 'Ext.container.Viewport',
16 Ext.onReady(function() {
35 html : 'Some content',
50 title: 'Masked Panel',
53 html : 'Some content',
59 p.body.mask('Loading...');
76 title: 'Framed Panel',
99 html : 'Some content',
107 Ext.createWidget('window', {
117 html : 'Click Submit for Confirmation Msg.',
132 handler: function() {
133 Ext.MessageBox.confirm('Confirm', 'Are you sure you want to do that?');
140 * Toolbar with a menu
142 var menu = Ext.createWidget('menu', {
145 {text: 'Check 1', checked: true},
146 {text: 'Check 2', checked: false},
148 {text: 'Option 1', checked: true, group: 'opts'},
149 {text: 'Option 2', checked: false, group: 'opts'},
153 menu: Ext.createWidget('menu', {
171 title: 'Basic Panel With Toolbars',
174 'Toolbar & Menus',
184 xtype: 'splitbutton',
185 text : 'Split Button',
186 menu : Ext.createWidget('menu', {
197 text : 'Toggle Button'
206 * Form and form widgets
212 title: 'Form Widgets',
242 bodyPadding: '10 20',
256 fieldLabel: 'TextField',
259 emptyText : 'Enter a value'
262 fieldLabel: 'ComboBox',
264 store: ['Foo', 'Bar']
267 fieldLabel: 'DateField',
272 fieldLabel: 'TimeField',
277 fieldLabel: 'NumberField',
278 xtype : 'numberfield',
280 emptyText : '(This field is optional)',
284 fieldLabel: 'TextArea',
285 xtype : 'textareafield',
287 cls : 'x-form-valid',
288 value : 'This field is hard-coded to have the "valid" style (it will require some code changes to add/remove this style dynamically)'
291 fieldLabel: 'Checkboxes',
292 xtype: 'checkboxgroup',
294 items: [{boxLabel: 'Foo', checked: true},{boxLabel: 'Bar'}]
297 fieldLabel: 'Radios',
300 items: [{boxLabel: 'Foo', checked: true, name: 'radios'},{boxLabel: 'Bar', name: 'radios'}]
305 xtype : 'htmleditor',
308 value : 'Mouse over toolbar for tooltips.<br /><br />The HTMLEditor IFrame requires a refresh between a stylesheet switch to get accurate colors.',
313 title : 'Plain Fieldset'
317 title : 'Collapsible Fieldset',
322 title : 'Checkbox Fieldset',
329 text :'Toggle Enabled',
330 handler: function() {
331 this.up('form').items.each(function(item) {
332 item.setDisabled(!item.disabled);
338 handler: function() {
339 Ext.getCmp('form-widgets').getForm().reset();
344 handler: function() {
345 Ext.getCmp('form-widgets').getForm().isValid();
362 title : 'BorderLayout Panel',
383 collapseMode: 'mini',
391 collapseMode: 'mini',
415 ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
416 ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
417 ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am'],
418 ['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],
419 ['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],
420 ['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],
421 ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
422 ['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],
423 ['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],
424 ['E.I. du Pont de Nemours and Company',40.48,0.51,1.28,'9/1 12:00am']
427 var store = Ext.create('Ext.data.ArrayStore', {
430 {name: 'price', type: 'float'},
431 {name: 'change', type: 'float'},
432 {name: 'pctChange', type: 'float'},
433 {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
436 property : 'company',
443 var pagingBar = Ext.createWidget('pagingtoolbar', {
446 displayMsg : 'Displaying topics {0} - {1} of {2}'
462 {header: "Company", flex: 1, sortable: true, dataIndex: 'company'},
463 {header: "Price", width: 75, sortable: true, dataIndex: 'price'},
464 {header: "Change", width: 75, sortable: true, dataIndex: 'change'},
465 {header: "% Change", width: 75, sortable: true, dataIndex: 'pctChange'},
466 {header: "Last Updated", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
479 xtype: 'triggerfield',
480 trigger1Cls: Ext.baseCSSPrefix + 'form-clear-trigger',
481 trigger2Cls: Ext.baseCSSPrefix + 'form-search-trigger'
486 //=============================================================
488 //=============================================================
489 var tree = Ext.create('Ext.tree.Panel', {
511 title : 'Accordion and TreePanel',
520 'background-color': '#eee'
529 html : 'Some content'
534 items.push(accConfig);
548 bodyStyle: 'padding:10px;'
554 html : 'Free-standing tab panel'
567 items.push(Ext.applyIf({
570 enableTabScroll: true,
575 html : 'Tab panel for display in a border layout'
600 items.push(Ext.apply({
621 //=============================================================
623 //=============================================================
624 var rszEl = Ext.getBody().createChild({
625 style: 'background: transparent;',
626 html: '<div style="padding:20px;">Resizable handles</div>'
629 rszEl.position('absolute', 1, 240, 1130);
630 rszEl.setSize(180, 180);
631 Ext.create('Ext.resizer.Resizer', {
638 * ProgressBar / Slider
640 var progressbar = Ext.createWidget('progressbar', {
646 title: 'ProgressBar / Slider',
683 title: 'Framed Grid',
686 emptyText: 'No images to display',
688 enableColumnMove: false,
690 {header: "Company", flex: 1, sortable: true, dataIndex: 'company'},
691 {header: "Price", width: 75, sortable: true, dataIndex: 'price'},
692 {header: "Change", width: 75, sortable: true, dataIndex: 'change'}
696 Ext.createWidget('viewport', {
703 text: 'Progress text...'
707 * Stylesheet Switcher
709 Ext.get('styleswitcher_select').on('change', function(e, select) {
710 var name = select[select.selectedIndex].value,
711 currentPath = window.location.pathname,
712 isCurrent = currentPath.match(name);
715 window.location = name;