]>
Commit | Line | Data |
---|---|---|
8067704a DM |
1 | Ext.define('PMG.MailStatGrid', { |
2 | extend: 'Ext.grid.GridPanel', | |
3 | xtype: 'pmgMailStatGrid', | |
4 | ||
5 | disableSelection: true, | |
6 | hideHeaders: true, | |
7 | ||
8 | store: { | |
9 | fields: [ 'name', 'value', 'percentage' ], | |
10 | }, | |
11 | ||
12 | columns: [ | |
13 | { | |
14 | flex: 1, | |
15 | dataIndex: 'name' | |
16 | }, | |
17 | { | |
18 | width: 150, | |
19 | dataIndex: 'value' | |
20 | }, | |
21 | { | |
22 | width: 300, | |
23 | ||
24 | xtype: 'widgetcolumn', | |
25 | dataIndex: 'percentage', | |
26 | widget: { | |
27 | xtype: 'progressbarwidget', | |
28 | textTpl: ['{percent:number("0")}%' ] | |
29 | }, | |
30 | ||
31 | onWidgetAttach: function (column, widget, rec) { | |
32 | if (rec.data.percentage === undefined) { | |
33 | widget.setStyle("visibility: hidden"); | |
34 | } else { | |
35 | widget.setStyle("visibility: visible"); | |
36 | } | |
37 | } | |
38 | } | |
39 | ] | |
40 | }); |