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