Sha256: 30e75681cc73b9b0aa98d93bebb1feccc5cea31a14eb43522df9eb86ce205c5a

Contents?: true

Size: 1.49 KB

Versions: 16

Compression:

Stored size: 1.49 KB

Contents

Ext.define("Compass.ErpApp.Desktop.Applications.Knitkit.WidgetsPanel",{
  extend:"Ext.panel.Panel",
  alias:'widget.knitkit_WidgetsPanel',

  constructor : function(config) {
    var widgetsStore = Ext.create('Ext.data.Store',{
      autoDestroy: true,
      fields:['name', 'iconUrl', 'onClick', 'about'],
      data:Compass.ErpApp.Widgets.AvailableWidgets
    });

    this.widgetsDataView = Ext.create("Ext.view.View",{
      style:'overflow:auto',
      itemSelector: 'div.thumb-wrap',
      store:widgetsStore,
      tpl: [
      '<tpl for=".">',
      '<div data-qtip="{about}" class="thumb-wrap" id="{name}">',
      '<div class="thumb"><img src="{iconUrl}" class="thumb-img"></div>',
      '<span>{name}</span></div>',
      '</tpl>',
      '<div class="x-clear"></div>'
      ],
      listeners:{
        'itemcontextmenu':function(view, record, htmlitem, index, e, options){
          e.stopEvent();
          var contextMenu = Ext.create("Ext.menu.Menu",{
            items:[{
              text:'Add Widget',
              iconCls:'icon-add',
              handler:function(btn){
                record.data.onClick();
              }
            }]
            });
          contextMenu.showAt(e.xy);
        }
      }
    });

    config = Ext.apply({
      id:'widgets',
      autoDestroy:true,
      title:'Widgets',
      margins: '5 5 5 0',
      layout:'fit',
      items: this.widgetsDataView
    }, config);

    this.callParent([config]);
  }
});



Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
knitkit-2.1.15 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.14 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.13 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.12 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.11 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.10 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.9 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.8 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.7 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.6 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.5 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.4 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.3 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.2 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.1 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js
knitkit-2.1.0 public/javascripts/erp_app/desktop/applications/knitkit/widgets_panel.js