Sha256: 4e28c5e57d35c83984f7320b1da777d9b6a58a4750cd0a27594d792c9fc9135f

Contents?: true

Size: 1.75 KB

Versions: 2

Compression:

Stored size: 1.75 KB

Contents

var store = Ext.create('Ext.data.TreeStore', {
    proxy: {
        type: 'ajax',
        url: '/knitkit/erp_app/desktop/website_host',
        timeout: 90000
    },
    root: {
        text: 'Host Mappings',
        iconCls: 'icon-gear',
        expanded: true
    },
    fields: [
        'text',
        'url',
        'iconCls',
        'websiteHostId',
        'host',
        'leaf'
    ],
    listeners: {
        'load': function (store, node, records) {
            store.getRootNode().expandChildren();
        }
    }
});

Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.HostListPanel", {
    extend: "Ext.tree.Panel",
    id: 'knitkitHostListPanel',
    itemId: 'knitkitHostListPanel',
    alias: 'widget.knitkit_hostspanel',
    header: false,

    viewConfig: {
        markDirty: false
    },

    store: store,

    clearWebsite: function(){
        var store = this.getStore();
        store.getProxy().extraParams = {};
        store.load();
    },

    selectWebsite: function (website) {
        var store = this.getStore();
        store.getProxy().extraParams = {
            website_id: website.id
        };
        store.load();
    },

    listeners: {
        'itemcontextmenu': function (view, record, htmlItem, index, e) {
            e.stopEvent();

            if (record.isRoot()) {
                items = [Compass.ErpApp.Desktop.Applications.Knitkit.newHostMenuItem];
            }
            else{
                items = Compass.ErpApp.Desktop.Applications.Knitkit.addHostOptions(self, [], record);
            }

            if (items.length != 0) {
                var contextMenu = Ext.create("Ext.menu.Menu", {
                    items: items
                });
                contextMenu.showAt(e.xy);
            }
        }
    }

});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
knitkit-3.2.0 app/assets/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js
knitkit-3.0.0 public/javascripts/erp_app/desktop/applications/knitkit/west_region/hosts_tree_panel.js