Resources/views/backend/view_snapshots/view/grid.js   A
last analyzed

Complexity

Total Complexity 5
Complexity/F 1

Size

Lines of Code 65
Function Count 5

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
nc 1
dl 0
loc 65
rs 10
c 1
b 0
f 0
wmc 5
mnd 0
bc 5
fnc 5
bpm 1
cpm 1
noi 2

4 Functions

Rating   Name   Duplication   Size   Complexity  
A Ext.define(ꞌShopware.apps.ViewSnapshots.view.Gridꞌ).getPagingBar 0 9 1
B Ext.define(ꞌShopware.apps.ViewSnapshots.view.Gridꞌ).getColumns 0 26 1
A Ext.define(ꞌShopware.apps.ViewSnapshots.view.Gridꞌ).getActionColumnItems 0 14 1
A Ext.define(ꞌShopware.apps.ViewSnapshots.view.Gridꞌ).initComponent 0 9 1
1
Ext.define('Shopware.apps.ViewSnapshots.view.Grid', {
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
2
    extend:'Ext.grid.Panel',
3
    border: false,
4
    alias:'widget.view-snapshot-window',
5
    region:'center',
6
    autoScroll:true,
7
    initComponent:function () {
8
        var me = this;
9
        me.columns = me.getColumns();
10
        me.pagingbar = me.getPagingBar();
11
        me.dockedItems = [
12
                me.pagingbar
13
            ];
14
        me.callParent(arguments);
15
    },
16
    getColumns:function () {
17
        var me = this;
18
19
        return [
20
            {
21
                header: 'Session ID',
22
                flex: 1,
23
                dataIndex: 'sessionID'
24
            },
25
            {
26
                header: 'Template',
27
                flex: 1,
28
                dataIndex: 'template'
29
            },
30
            {
31
                header: 'Step',
32
                dataIndex: 'step',
33
                width: 40
34
            },
35
            {
36
                xtype: 'actioncolumn',
37
                width: 30,
38
                items: me.getActionColumnItems()
39
            }
40
        ];
41
    },
42
    getActionColumnItems: function () {
43
        return [
44
                {
45
                    iconCls: 'x-action-col-icon sprite-globe--arrow',
46
                    tooltip: 'Open',
47
                    handler: function (view, rowIndex) {
48
                        var store = view.getStore(),
49
                            record = store.getAt(rowIndex);
50
51
                        window.open(record.get('url'), '_blank');
52
                    }
53
                }
54
            ];
55
    },
56
    getPagingBar: function () {
57
        var me = this;
58
59
        return Ext.create('Ext.toolbar.Paging', {
0 ignored issues
show
Bug introduced by
The variable Ext seems to be never declared. If this is a global, consider adding a /** global: Ext */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
60
            store: me.store,
61
            dock: 'bottom',
62
            displayInfo: true
63
        });
64
    }
65
});
66