javascripts/netzkeremotecombo.js in netzke-basepack-0.12.9 vs javascripts/netzkeremotecombo.js in netzke-basepack-1.0.0.0.pre
- old
+ new
@@ -6,28 +6,20 @@
displayField : 'text',
triggerAction : 'all',
forceSelection: true,
initComponent : function(){
- var parent = this.netzkeParent || this.findParentBy(function(c) { return c.isNetzke; }),
- modelName = parent.id + "_" + this.name;
+ var parent = this.netzkeParent || this.findParentBy(function(c) { return c.isNetzke; });
if (this.blankLine == undefined) this.blankLine = "---";
- if (!Netzke.isModelDefined(modelName)) {
- Ext.define(Netzke.modelName(modelName), {
- extend: 'Ext.data.Model',
- fields: ['value', 'text']
- });
- };
-
var store = new Ext.data.Store({
- model: Netzke.modelName(modelName),
+ fields: ['value', 'text'],
proxy: {
type: 'direct',
- directFn: Netzke.providers[parent.id].getComboboxOptions,
- extraParams: {configs: parent.buildParentClientConfigs()},
+ directFn: parent.netzkeGetDirectFunction("getComboboxOptions"),
+ extraParams: {configs: parent.netzkeBuildParentConfigs()},
reader: {
type: 'array',
rootProperty: 'data'
}
}
@@ -39,10 +31,10 @@
// 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(Netzke.modelName(modelName), {value: -1, text: this.blankLine}));
+ 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});