2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
10 Ext.onReady(function(){
\r
11 Ext.QuickTips.init();
\r
12 Ext.form.Field.prototype.msgTarget = 'side';
\r
14 /* Language chooser combobox */
\r
15 var store = new Ext.data.SimpleStore({
\r
16 fields: ['code', 'language', 'charset'],
\r
17 data : Ext.exampledata.languages // from languages.js
\r
19 var combo = new Ext.form.ComboBox({
\r
21 displayField:'language',
\r
24 triggerAction: 'all',
\r
25 emptyText:'Select a language...',
\r
27 onSelect: function(record) {
\r
28 window.location.search = Ext.urlEncode({"lang":record.get("code"),"charset":record.get("charset")});
\r
31 combo.render('languages');
\r
33 // get the selected language code parameter from url (if exists)
\r
34 var params = Ext.urlDecode(window.location.search.substring(1));
\r
36 // check if there's really a language with that language code
\r
37 record = store.data.find(function(item, key) {
\r
38 if (item.data.code==params.lang){
\r
43 // if language was found in store assign it as current value in combobox
\r
45 combo.setValue(record.data.language);
\r
50 var emailfield = new Ext.FormPanel({
\r
51 labelWidth: 100, // label settings here cascade unless overridden
\r
53 title: 'Email Field',
\r
54 bodyStyle:'padding:5px 5px 0',
\r
56 defaults: {width: 220},
\r
57 defaultType: 'textfield',
\r
60 fieldLabel: 'Email',
\r
66 emailfield.render('emailfield');
\r
69 var datefield = new Ext.FormPanel({
\r
70 labelWidth: 100, // label settings here cascade unless overridden
\r
72 title: 'Datepicker',
\r
73 bodyStyle:'padding:5px 5px 0',
\r
75 defaults: {width: 220},
\r
76 defaultType: 'datefield',
\r
84 datefield.render('datefield');
\r
87 var fm = Ext.form, Ed = Ext.grid.GridEditor;
\r
88 var monthArray = Date.monthNames.map(function (e) { return [e]; });
\r
89 var ds = new Ext.data.Store({
\r
90 proxy: new Ext.data.PagingMemoryProxy(monthArray),
\r
91 reader: new Ext.data.ArrayReader({}, [
\r
95 var cm = new Ext.grid.ColumnModel([{
\r
96 header: "Months of the year",
\r
98 editor: new Ed(new fm.TextField({
\r
103 cm.defaultSortable = true;
\r
104 var grid = new Ext.grid.GridPanel({
\r
108 title:'Month Browser',
\r
111 sm: new Ext.grid.RowSelectionModel({selectRow:Ext.emptyFn}),
\r
113 bbar: new Ext.PagingToolbar({
\r
121 // trigger the data store load
\r
122 ds.load({params:{start:0, limit:6}});
\r