TimesPanel.js
1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
Ext.define('treps.view.Times.TimesPanel' ,{
extend: 'Ext.form.Panel',
alias: 'widget.times_panel',
initComponent: function() {
this.callParent(arguments);
},
title: 'Time Field',
addcheckbox: false,
tools: [
{
type: 'help',
pageId: 'time'
}
],
layout: {
type: 'vbox',
padding: 5,
margin: 5,
align: 'stretch'
},
items: [
{
xtype: 'combo',
name: 'timeformat',
fieldLabel: 'Time format',
queryMode: 'local',
editable: false,
valueField: 'id',
tpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<tpl if="pattern">',
'<div class="x-boundlist-item">{fullname} - {pattern}</div>',
'<tpl else>',
'<div class="x-boundlist-item">{fullname}</div>',
'</tpl>',
'</tpl>'
),
displayTpl: Ext.create('Ext.XTemplate',
'<tpl for=".">',
'<tpl if="pattern">',
'{fullname} - {pattern}',
'<tpl else>',
'{fullname}',
'</tpl>',
'</tpl>'
)
},
{
xtype: 'textfield',
name: 'timepattern',
fieldLabel: 'Time pattern'
}
],
listeners : {
afterrender : function()
{
if (this.addcheckbox)
{
//insert chack box in header
var check = Ext.create('Ext.form.field.Checkbox',{});
this.header.insert(0,check);
}
}
}
});