Upgrade to ExtJS 3.0.0 - Released 07/06/2009
[extjs.git] / docs / source / DirectCombo.html
1 <html>\r
2 <head>\r
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
6 </head>\r
7 <body  onload="prettyPrint();">\r
8     <pre class="prettyprint lang-js">Imgorg.DirectCombo = Ext.extend(Ext.form.ComboBox, {
9     displayField: 'text',
10     valueField: 'id',
11     triggerAction: 'all',
12     queryAction: 'name',
13     forceSelection: true,
14     mode: 'remote',
15     
16     initComponent: function() {
17         this.store = new Ext.data.DirectStore(Ext.apply({
18             api: this.api,
19             root: '',
20             fields: this.fields || ['text', 'id']
21         }, this.storeConfig));
22         
23         Imgorg.DirectCombo.superclass.initComponent.call(this);
24     }
25 });
26
27 Imgorg.TagCombo = Ext.extend(Imgorg.DirectCombo,{
28     forceSelection: false,
29     storeConfig: {
30         id: 'tag-store'
31     },
32     initComponent: function() {
33         Ext.apply(this.storeConfig, {
34             directFn: Imgorg.ss.Tags.load
35         });
36         Imgorg.TagCombo.superclass.initComponent.call(this);
37     }
38 });
39 Ext.reg('img-tagcombo', Imgorg.TagCombo);
40
41 Imgorg.TagMultiCombo = Ext.extend(Ext.ux.MultiCombo,{
42     listClass: 'label-combo',
43     displayField: 'text',
44     valueField: 'id',
45     
46     initComponent: function() {
47         this.store = new Ext.data.DirectStore(Ext.apply({
48             directFn: Imgorg.ss.Tags.load,
49             root: '',
50             autoLoad: true,
51             fields: this.fields || ['text', 'id']
52         }, this.storeConfig));
53         this.plugins =new Ext.ux.MultiCombo.Checkable({});
54         Imgorg.DirectCombo.superclass.initComponent.call(this);
55     }
56 });
57 Ext.reg('img-tagmulticombo', Imgorg.TagMultiCombo);
58
59 Imgorg.AlbumCombo = Ext.extend(Imgorg.DirectCombo, {
60     storeConfig: {
61         id: 'album-store'
62     },
63     initComponent: function() {
64         Ext.apply(this.storeConfig, {
65             directFn: Imgorg.ss.Albums.getAllInfo
66         });
67         Imgorg.AlbumCombo.superclass.initComponent.call(this);
68     }
69 });
70 Ext.reg('img-albumcombo', Imgorg.AlbumCombo);
71 </pre>    \r
72 </body>\r
73 </html>