partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

StorageLocationGrid.js (1384B)


      1 Ext.define('PartKeepr.StorageLocationGrid', {
      2     extend: 'PartKeepr.EditorGrid',
      3     xtype: 'partkeepr.StorageLocationGrid',
      4 
      5     features: [
      6         {
      7             ftype: 'grouping',
      8             groupHeaderTpl: '{name} ({children.length})',
      9             enableNoGroups: true
     10         }
     11     ],
     12 
     13     columns: [
     14         {header: i18n("Storage Location"), dataIndex: 'name', flex: 1}
     15     ],
     16     addButtonText: i18n("Add Storage Location"),
     17     addButtonIconCls: 'fugue-icon wooden-box--plus',
     18     deleteButtonText: i18n("Delete Storage Location"),
     19     deleteButtonIconCls: 'fugue-icon wooden-box--minus',
     20     initComponent: function ()
     21     {
     22         this.callParent();
     23 
     24         if (this.enableEditing) {
     25             // Adds a button which shows the multi-create window
     26             this.multiCreateButton = Ext.create("Ext.button.Button", {
     27                 iconCls: 'partkeepr-icon storagelocation_multiadd',
     28                 tooltip: i18n("Multi-create storage locations"),
     29                 handler: this.onMultiCreateClick,
     30                 scope: this
     31             });
     32 
     33             this.topToolbar.insert(2, {xtype: 'tbseparator'});
     34             this.topToolbar.insert(3, this.multiCreateButton);
     35         }
     36     },
     37     /**
     38      * Creates a new storage location multi-create window.
     39      */
     40     onMultiCreateClick: function ()
     41     {
     42         this.fireEvent("storageLocationMultiAdd");
     43     }
     44 });