source: trunk/web/addons/job_monarch/lib/extjs-30/examples/image-organizer/imgorg/DirectCombo.js @ 625

Last change on this file since 625 was 625, checked in by ramonb, 15 years ago

lib/extjs-30:

  • new ExtJS 3.0
File size: 1.9 KB
Line 
1/*!
2 * Ext JS Library 3.0.0
3 * Copyright(c) 2006-2009 Ext JS, LLC
4 * licensing@extjs.com
5 * http://www.extjs.com/license
6 */
7Imgorg.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
26Imgorg.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});
38Ext.reg('img-tagcombo', Imgorg.TagCombo);
39
40Imgorg.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});
56Ext.reg('img-tagmulticombo', Imgorg.TagMultiCombo);
57
58Imgorg.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});
69Ext.reg('img-albumcombo', Imgorg.AlbumCombo);
Note: See TracBrowser for help on using the repository browser.