diff --git a/pyweb/djextdirect/__init__.py b/pyweb/djextdirect/__init__.py index cb2deee..c2eba36 100644 --- a/pyweb/djextdirect/__init__.py +++ b/pyweb/djextdirect/__init__.py @@ -15,7 +15,7 @@ * GNU General Public License for more details. """ -VERSION = ( 0, 7 ) +VERSION = ( 0, 8 ) VERSIONSTR = "v%d.%d" % VERSION diff --git a/pyweb/djextdirect/formprovider.py b/pyweb/djextdirect/formprovider.py index 141998d..05741d5 100644 --- a/pyweb/djextdirect/formprovider.py +++ b/pyweb/djextdirect/formprovider.py @@ -15,7 +15,7 @@ * GNU General Public License for more details. """ -import json as json +import json import functools @@ -57,13 +57,6 @@ Ext.ux.%(clsname)s = function( config ){ 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 ); this.form.api = this.api; @@ -130,26 +123,25 @@ Ext.ux.ChoicesCombo = function( config ){ }); this.triggerAction = 'all'; - 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'], reader: new Ext.data.JsonReader({ successProperty: 'success', idProperty: this.valueField, root: 'data', fields: [this.valueField, this.displayField] - }) - }); + }), + autoLoad: true + }); Ext.ux.ChoicesCombo.superclass.constructor.call( this ); - this.store.load(); -}; + }; Ext.extend( Ext.ux.ChoicesCombo, Ext.form.ComboBox, { -}); + }); Ext.reg( 'choicescombo', Ext.ux.ChoicesCombo ); """ diff --git a/pyweb/djextdirect/provider.py b/pyweb/djextdirect/provider.py index 57f20cf..452243a 100644 --- a/pyweb/djextdirect/provider.py +++ b/pyweb/djextdirect/provider.py @@ -15,8 +15,7 @@ * GNU General Public License for more details. """ -import json as json - +import json import inspect import functools import traceback