Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* dict.js
*
* Script to test the Dict form field.
*
*/
// Activate the dynamic loading for Ext JS and application classes
App.setDynamicLoading(App.debug);
// classes required by the script
Ext.require('Ext.form.Panel');
Ext.require('Ext.tip.QuickTipManager');
Ext.require('App.form.field.Dict');
Ext.onReady(function(){
"use strict";
var form;
Ext.QuickTips.init();
form = Ext.create('Ext.form.Panel', {
title: 'Dict',
bodyPadding: 5,
width: 350,
layout: 'anchor',
defaults: {
anchor: '100%'
},
items: [{
fieldLabel: 'MyText',
xtype: 'textfield'
}, {
fieldLabel: 'MyDict',
xtype: 'xdictfield',
value: {
"(name)": "My string",
"Created": new Date(Date.parse('10/15/2006')),
"Available": false,
"Version": 0.01,
"Description": "A test string"
},
hideHeader: false,
modifyKeys: true,
listeners: {
keychange: {
fn: function (cmp, action, oldKey, newKey) {
Ext.Msg.alert('Event', action + ' ' + oldKey + ' ' + newKey);
}
}
}