3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js">Ext.onReady(function(){
\r
10 Ext.QuickTips.init();
\r
11 Ext.form.Field.prototype.msgTarget = 'side';
\r
14 * Ext.ux.form.MultiSelect Example Code
\r
16 var msForm = new Ext.form.FormPanel({
\r
17 title: 'MultiSelect Test',
\r
19 bodyStyle: 'padding:10px;',
\r
20 renderTo: 'multiselect',
\r
22 xtype: 'multiselect',
\r
23 fieldLabel: 'Multiselect<br />(Required)',
\r
24 name: 'multiselect',
\r
28 store: [[123,'One Hundred Twenty Three'],
\r
29 ['1', 'One'], ['2', 'Two'], ['3', 'Three'], ['4', 'Four'], ['5', 'Five'],
\r
30 ['6', 'Six'], ['7', 'Seven'], ['8', 'Eight'], ['9', 'Nine']],
\r
33 handler: function(){
\r
34 msForm.getForm().findField('multiselect').reset();
\r
42 text: 'Set Value (2,3)',
\r
43 handler: function(){
\r
44 msForm.getForm().findField('multiselect').setValue('2,3');
\r
47 text: 'Toggle Enabled',
\r
48 handler: function(){
\r
49 var m = msForm.getForm().findField('multiselect');
\r
61 handler: function(){
\r
62 if(msForm.getForm().isValid()){
\r
63 Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+
\r
64 msForm.getForm().getValues(true));
\r
71 var ds = new Ext.data.ArrayStore({
\r
72 data: [[123,'One Hundred Twenty Three'],
\r
73 ['1', 'One'], ['2', 'Two'], ['3', 'Three'], ['4', 'Four'], ['5', 'Five'],
\r
74 ['6', 'Six'], ['7', 'Seven'], ['8', 'Eight'], ['9', 'Nine']],
\r
75 fields: ['value','text'],
\r
83 * Ext.ux.form.ItemSelector Example Code
\r
85 var isForm = new Ext.form.FormPanel({
\r
86 title: 'ItemSelector Test',
\r
88 bodyStyle: 'padding:10px;',
\r
89 renderTo: 'itemselector',
\r
91 xtype: 'itemselector',
\r
92 name: 'itemselector',
\r
93 fieldLabel: 'ItemSelector',
\r
94 imagePath: '../ux/images/',
\r
99 displayField: 'text',
\r
100 valueField: 'value'
\r
104 store: [['10','Ten']],
\r
107 handler:function(){
\r
108 isForm.getForm().findField('itemselector').reset();
\r
116 handler: function(){
\r
117 if(isForm.getForm().isValid()){
\r
118 Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+
\r
119 isForm.getForm().getValues(true));
\r