Upgrade to ExtJS 3.0.3 - Released 10/11/2009
[extjs.git] / examples / image-organizer / imgorg / DirectCombo.js
1 /*!
2  * Ext JS Library 3.0.3
3  * Copyright(c) 2006-2009 Ext JS, LLC
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 Imgorg.DirectCombo = Ext.extend(Ext.form.ComboBox, {
8     displayField: 'text',
9     valueField: 'id',
10     triggerAction: 'all',
11     queryAction: 'name',
12     forceSelection: true,
13     mode: 'remote',
14     
15     initComponent: function() {
16         this.store = new Ext.data.DirectStore(Ext.apply({
17             api: this.api,
18             root: '',
19             fields: this.fields || ['text', 'id']
20         }, this.storeConfig));
21         
22         Imgorg.DirectCombo.superclass.initComponent.call(this);
23     }
24 });
25
26 Imgorg.TagCombo = Ext.extend(Imgorg.DirectCombo,{
27     forceSelection: false,
28     storeConfig: {
29         id: 'tag-store'
30     },
31     initComponent: function() {
32         Ext.apply(this.storeConfig, {
33             directFn: Imgorg.ss.Tags.load
34         });
35         Imgorg.TagCombo.superclass.initComponent.call(this);
36     }
37 });
38 Ext.reg('img-tagcombo', Imgorg.TagCombo);
39
40 Imgorg.TagMultiCombo = Ext.extend(Ext.ux.MultiCombo,{
41     listClass: 'label-combo',
42     displayField: 'text',
43     valueField: 'id',
44     
45     initComponent: function() {
46         this.store = new Ext.data.DirectStore(Ext.apply({
47             directFn: Imgorg.ss.Tags.load,
48             root: '',
49             autoLoad: true,
50             fields: this.fields || ['text', 'id']
51         }, this.storeConfig));
52         this.plugins =new Ext.ux.MultiCombo.Checkable({});
53         Imgorg.DirectCombo.superclass.initComponent.call(this);
54     }
55 });
56 Ext.reg('img-tagmulticombo', Imgorg.TagMultiCombo);
57
58 Imgorg.AlbumCombo = Ext.extend(Imgorg.DirectCombo, {
59     storeConfig: {
60         id: 'album-store'
61     },
62     initComponent: function() {
63         Ext.apply(this.storeConfig, {
64             directFn: Imgorg.ss.Albums.getAllInfo
65         });
66         Imgorg.AlbumCombo.superclass.initComponent.call(this);
67     }
68 });
69 Ext.reg('img-albumcombo', Imgorg.AlbumCombo);