1 |
rovere |
1.1 |
Ext.ns('RefSubSys');
|
2 |
|
|
|
3 |
rovere |
1.2 |
Ext.BLANK_IMAGE_URL = '/ext/resources/images/default/s.gif';
|
4 |
rovere |
1.1 |
|
5 |
|
|
RefSubSys.ComboSubSystems = Ext.extend(
|
6 |
|
|
Ext.form.ComboBox,{
|
7 |
|
|
// configurable that can be set at runtime
|
8 |
|
|
border: false
|
9 |
|
|
,displayField:'subsystem'
|
10 |
|
|
,valueField: 'value'
|
11 |
|
|
,typeAhead: true
|
12 |
|
|
,loadingText: 'Loading...'
|
13 |
|
|
,forceSelection: false
|
14 |
|
|
// This is needed in order to have typeahead working properly!!
|
15 |
|
|
// BUT this implies that the combo is populated immediately and never refreshed...
|
16 |
|
|
,mode:'local'
|
17 |
|
|
,triggerAction: 'all'
|
18 |
|
|
,enableKeyEvents: true
|
19 |
|
|
,fieldLabel: 'SubSystems'
|
20 |
|
|
// If true, the following property causes a reload of the combo everytime the 'expand'
|
21 |
|
|
// event is fired
|
22 |
|
|
,noCache: false
|
23 |
|
|
,consoleLog:false
|
24 |
|
|
// ,width: 100
|
25 |
|
|
,initComponent:function() {
|
26 |
|
|
Ext.apply(this,{
|
27 |
|
|
store: new Ext.data.JsonStore(
|
28 |
|
|
{
|
29 |
|
|
root: 'rows'
|
30 |
|
|
,fields:
|
31 |
|
|
[
|
32 |
|
|
{name: 'id', mapping: 'id', type: 'int'}
|
33 |
|
|
,{name: 'subsystem', mapping: 'subsystem', type:'string'}
|
34 |
|
|
,{name: 'value', mapping: 'value', type:'string'}
|
35 |
|
|
]
|
36 |
|
|
,url:'/cgi-bin/ReferencePythonCLI/driver.py'
|
37 |
|
|
,baseParams:
|
38 |
|
|
{
|
39 |
|
|
action: 'subsystems'
|
40 |
|
|
// action: 'test'
|
41 |
|
|
}
|
42 |
|
|
,autoLoad: false
|
43 |
|
|
}
|
44 |
|
|
)
|
45 |
|
|
}
|
46 |
|
|
);
|
47 |
|
|
RefSubSys.ComboSubSystems.superclass.initComponent.apply(this, arguments);
|
48 |
|
|
if(this.consoleLog)
|
49 |
|
|
console.log('Inside RefSubSys.ComboSubsystems.initComponent. noCache value is ', this.noCache );
|
50 |
|
|
} // eo function initComponent
|
51 |
|
|
|
52 |
|
|
,onRender:function()
|
53 |
|
|
{
|
54 |
|
|
RefLocalTag.ComboTag.superclass.onRender.apply(this, arguments);
|
55 |
|
|
if(this.consoleLog)
|
56 |
|
|
console.log('RefSubSys.ComboSubsystems.onRender called') ;
|
57 |
|
|
|
58 |
|
|
if(this.noCache)
|
59 |
|
|
{
|
60 |
|
|
this.on('expand',this.loadNoCache,this) ;
|
61 |
|
|
}
|
62 |
|
|
this.store.load() ;
|
63 |
|
|
this.store.on('load',this.loadComplete);
|
64 |
|
|
} // eo funtion onRender
|
65 |
|
|
|
66 |
|
|
,loadComplete:function()
|
67 |
|
|
{
|
68 |
|
|
if(this.consoleLog)
|
69 |
|
|
console.log('Ext.SubSys.ComboSubSystems store loaded ');
|
70 |
|
|
}
|
71 |
|
|
,loadNoCache:function()
|
72 |
|
|
{
|
73 |
|
|
if(this.consoleLog)
|
74 |
|
|
console.log('Ext.SubSys.ComboSubSystems store loaded through noCache method');
|
75 |
|
|
this.store.load() ;
|
76 |
|
|
}
|
77 |
|
|
}
|
78 |
|
|
);
|
79 |
|
|
|
80 |
|
|
Ext.reg('subsyscombo', RefSubSys.ComboSubSystems);
|
81 |
|
|
|
82 |
|
|
|