|
@ -15,7 +15,7 @@ |
|
|
* GNU General Public License for more details. |
|
|
* GNU General Public License for more details. |
|
|
""" |
|
|
""" |
|
|
|
|
|
|
|
|
import json as json |
|
|
|
|
|
|
|
|
import json |
|
|
|
|
|
|
|
|
import functools |
|
|
import functools |
|
|
|
|
|
|
|
@ -57,13 +57,6 @@ Ext.ux.%(clsname)s = function( config ){ |
|
|
|
|
|
|
|
|
this.api = %(apiconf)s; |
|
|
this.api = %(apiconf)s; |
|
|
|
|
|
|
|
|
for( var i = 0; i < this.items.length; i++ ){ |
|
|
|
|
|
if( this.items[i].xtype == "choicescombo" ){ |
|
|
|
|
|
this.items[i].pk = config.pk; |
|
|
|
|
|
this.items[i].api = this.api; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Ext.ux.%(clsname)s.superclass.constructor.call( this ); |
|
|
Ext.ux.%(clsname)s.superclass.constructor.call( this ); |
|
|
|
|
|
|
|
|
this.form.api = this.api; |
|
|
this.form.api = this.api; |
|
@ -130,26 +123,25 @@ Ext.ux.ChoicesCombo = function( config ){ |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
this.triggerAction = 'all'; |
|
|
this.triggerAction = 'all'; |
|
|
|
|
|
|
|
|
this.store = new Ext.data.DirectStore({ |
|
|
this.store = new Ext.data.DirectStore({ |
|
|
baseParams: {'pk': this.pk, 'field': this.name}, |
|
|
|
|
|
directFn: this.api.choices, |
|
|
|
|
|
|
|
|
baseParams: {'pk': this.ownerCt.pk, 'field': this.name}, |
|
|
|
|
|
directFn: this.ownerCt.api.choices, |
|
|
paramOrder: ['pk', 'field'], |
|
|
paramOrder: ['pk', 'field'], |
|
|
reader: new Ext.data.JsonReader({ |
|
|
reader: new Ext.data.JsonReader({ |
|
|
successProperty: 'success', |
|
|
successProperty: 'success', |
|
|
idProperty: this.valueField, |
|
|
idProperty: this.valueField, |
|
|
root: 'data', |
|
|
root: 'data', |
|
|
fields: [this.valueField, this.displayField] |
|
|
fields: [this.valueField, this.displayField] |
|
|
}) |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}), |
|
|
|
|
|
autoLoad: true |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Ext.ux.ChoicesCombo.superclass.constructor.call( this ); |
|
|
Ext.ux.ChoicesCombo.superclass.constructor.call( this ); |
|
|
this.store.load(); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
Ext.extend( Ext.ux.ChoicesCombo, Ext.form.ComboBox, { |
|
|
Ext.extend( Ext.ux.ChoicesCombo, Ext.form.ComboBox, { |
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
Ext.reg( 'choicescombo', Ext.ux.ChoicesCombo ); |
|
|
Ext.reg( 'choicescombo', Ext.ux.ChoicesCombo ); |
|
|
""" |
|
|
""" |
|
|