X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..7a654f8d43fdb43d78b63d90528bed6e86b608cc:/examples/slider/slider-field.js diff --git a/examples/slider/slider-field.js b/examples/slider/slider-field.js index 78c51b19..729cb4da 100644 --- a/examples/slider/slider-field.js +++ b/examples/slider/slider-field.js @@ -1,20 +1,17 @@ -/*! - * Ext JS Library 3.2.0 - * Copyright(c) 2006-2010 Ext JS, Inc. - * licensing@extjs.com - * http://www.extjs.com/license - */ +Ext.require([ + 'Ext.slider.*', + 'Ext.form.*', + 'Ext.window.MessageBox' +]); + Ext.onReady(function(){ - var form = new Ext.form.FormPanel({ - width : 400, + Ext.create('Ext.form.Panel', { + width: 400, height: 160, - title : 'Sound Settings', - - bodyStyle : 'padding: 10px;', - renderTo : 'container', + title: 'Sound Settings', + bodyPadding: 10, + renderTo: 'container', defaultType: 'sliderfield', - buttonAlign: 'left', - defaults: { anchor: '95%', tipText: function(thumb){ @@ -34,29 +31,36 @@ Ext.onReady(function(){ value: 25, name: 'iface' }], - fbar: { + dockedItems: { xtype: 'toolbar', + dock: 'bottom', + ui: 'footer', items: [{ text: 'Max All', handler: function(){ - form.items.each(function(c){ + this.up('form').items.each(function(c){ c.setValue(100); }); } }, '->', { text: 'Save', handler: function(){ - var values = form.getForm().getValues(), + var values = this.up('form').getForm().getValues(), s = ['Sounds Effects: {0}%', 'Ambient Sounds: {1}%', 'Interface Sounds: {2}%']; - - Ext.example.msg('Settings Saved', s.join('
'), values.fx, values.ambient, values.iface); + + Ext.Msg.alert({ + title: 'Settings Saved', + msg: Ext.String.format(s.join('
'), values.fx, values.ambient, values.iface), + icon: Ext.Msg.INFO, + buttons: Ext.Msg.OK + }); } },{ text: 'Reset', handler: function(){ - form.getForm().reset(); + this.up('form').getForm().reset(); } }] }