Sha256: bdbaa99f39e4533dd523b7c65b4ad204d28f2809f799ab1d9bf44d6007137c5e
Contents?: true
Size: 1.45 KB
Versions: 1
Compression:
Stored size: 1.45 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 modelName = this.parentId + "_" + this.name; if (this.blankLine == undefined) this.blankLine = "---"; Ext.define(modelName, { extend: 'Ext.data.Model', fields: ['value', 'text'] }); var store = new Ext.data.Store({ model: modelName, proxy: { type: 'direct', directFn: Netzke.providers[this.parentId].getComboboxOptions, 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(modelName, {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
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
netzke-basepack-0.12.0.beta | javascripts/netzkeremotecombo.js |