Sha256: bf04b9543e4c60dd0050a0ae26bcff7ced5972058f85623b0b7f9ddbf3fe875c

Contents?: true

Size: 1.47 KB

Versions: 9

Compression:

Stored size: 1.47 KB

Contents

// ComboBox that gets options from the server (used in both grids and panels)
Ext.define('Ext.netzke.ComboBox', {
  extend        : 'Ext.form.field.ComboBox',
  alias         : 'widget.netzkeremotecombo',
  valueField    : 'value',
  displayField  : 'text',
  triggerAction : 'all',
  forceSelection: true,

  initComponent : function(){
    var parent = this.netzkeParent || this.findParentBy(function(c) { return c.isNetzke; });

    if (this.blankLine == undefined) this.blankLine = "---";

    var store = new Ext.data.Store({
      fields: ['value', 'text'],
      proxy: {
        type: 'direct',
        directFn: parent.netzkeGetDirectFunction("getComboboxOptions"),
        extraParams: {configs: parent.netzkeBuildParentConfigs()},
        reader: {
          type: 'array',
          rootProperty: 'data'
        }
      }
    });

    store.on('beforeload', function(self, op) {
      op.setParams(Ext.apply(op.getParams(), {attr: this.name}));
    }, this);

    // insert a selectable "blank line" which allows to remove the associated record
    if (this.blankLine) {
      store.on('load', function(self, params) {
        // append a selectable "empty line" which will allow remove the association
        self.add(Ext.create(store.getModel(), {value: -1, text: this.blankLine}));
      }, this);
    }

    // If inline data was passed (TODO: is this actually working?)
    if (this.store) store.loadData({data: this.store});

    this.store = store;

    this.callParent();
  }
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
netzke-basepack-6.5.0.0 javascripts/netzkeremotecombo.js
netzke-basepack-6.5.0.0.rc2 javascripts/netzkeremotecombo.js
netzke-basepack-6.5.0.0.rc1 javascripts/netzkeremotecombo.js
netzke-basepack-1.0.1.0 javascripts/netzkeremotecombo.js
netzke-basepack-1.0.0.1 javascripts/netzkeremotecombo.js
netzke-basepack-1.0.0.0 javascripts/netzkeremotecombo.js
netzke-basepack-1.0.0.0.pre3 javascripts/netzkeremotecombo.js
netzke-basepack-1.0.0.0.pre2 javascripts/netzkeremotecombo.js
netzke-basepack-1.0.0.0.pre javascripts/netzkeremotecombo.js