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
9 Ext.onReady(function(){
\r
11 Ext.QuickTips.init();
\r
12 Ext.form.Field.prototype.msgTarget = 'side';
\r
15 * Ext.ux.Multiselect Example Code
\r
17 var msForm = new Ext.form.FormPanel({
\r
18 title: 'MultiSelect Test',
\r
20 bodyStyle: 'padding:10px;',
\r
21 renderTo: 'multiselect',
\r
23 xtype:"multiselect",
\r
24 fieldLabel:"Multiselect<br />(Required)",
\r
26 dataFields:["code", "desc"],
\r
28 displayField:"desc",
\r
32 data:[[123,"One Hundred Twenty Three"],
\r
33 ["1", "One"], ["2", "Two"], ["3", "Three"], ["4", "Four"], ["5", "Five"],
\r
34 ["6", "Six"], ["7", "Seven"], ["8", "Eight"], ["9", "Nine"]],
\r
38 msForm.getForm().findField("multiselect").reset();
\r
45 text:"Set Value (2,3)",
\r
46 handler: function(){
\r
47 msForm.getForm().findField("multiselect").setValue("2,3");
\r
50 text:"Toggle Enabled",
\r
51 handler: function(){
\r
52 var m=msForm.getForm().findField("multiselect");
\r
53 if (!m.disabled)m.disable();
\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
72 * Ext.ux.ItemSelector Example Code
\r
74 var isForm = new Ext.form.FormPanel({
\r
75 title: 'ItemSelector Test',
\r
77 bodyStyle: 'padding:10px;',
\r
78 renderTo: 'itemselector',
\r
80 xtype:"itemselector",
\r
81 name:"itemselector",
\r
82 fieldLabel:"ItemSelector",
\r
83 dataFields:["code", "desc"],
\r
84 toData:[["10", "Ten"]],
\r
88 displayField:"desc",
\r
89 imagePath:"images/",
\r
90 toLegend:"Selected",
\r
91 fromLegend:"Available",
\r
92 fromData:[[123,"One Hundred Twenty Three"],
\r
93 ["1", "One"], ["2", "Two"], ["3", "Three"], ["4", "Four"], ["5", "Five"],
\r
94 ["6", "Six"], ["7", "Seven"], ["8", "Eight"], ["9", "Nine"]],
\r
98 var i=isForm.getForm().findField("itemselector");
\r
106 handler: function(){
\r
107 if(isForm.getForm().isValid()){
\r
108 Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+
\r
109 isForm.getForm().getValues(true));
\r