Browse Source

implement baseParams and display of general errors as a messagebox

Natenom/support-murmur-13-1446181288462
Michael Ziegler 14 years ago
parent
commit
17843716e2
  1. 13
      pyweb/djextdirect.py
  2. 4
      pyweb/mumble/templates/mumble/mumble.html

13
pyweb/djextdirect.py

@ -68,10 +68,18 @@ Ext.ux.%(clsname)s = function( config ){
Ext.extend( Ext.ux.%(clsname)s, Ext.form.FormPanel, {
load: function(){
this.getForm().load({ params: {pk: this.pk} });
this.getForm().load({ params: Ext.applyIf( {pk: this.pk}, this.baseParams ) });
},
submit: function(){
this.getForm().submit({ params: {pk: this.pk} });
this.getForm().submit({
params: Ext.applyIf( {pk: this.pk}, this.baseParams ),
failure: function( form, action ){
if( action.failureType == Ext.form.Action.SERVER_INVALID &&
typeof action.result.errors[''] != 'undefined' ){
Ext.Msg.alert( "Error", action.result.errors[''] );
}
}
});
},
} );
@ -483,6 +491,7 @@ class Provider( object ):
'fileUpload: ' + simplejson.dumps(hasfiles) + ','
'defaults: { "anchor": "-20px" },'
'paramsAsHash: true,'
'baseParams: {},'
'autoScroll: true,'
"""buttons: [{
text: "Submit",

4
pyweb/mumble/templates/mumble/mumble.html

@ -72,9 +72,7 @@
xtype: "{{ RegForm|lower }}",
pk: {% if MumbleAccount %}{{ MumbleAccount.id }}{% else %}-1{% endif %},
labelWidth: 150,
submit: function(){
this.getForm().submit({ params: {serverid: {{MumbleServer.id}}, pk: this.pk } });
},
baseParams: {serverid: {{MumbleServer.id}} },
},
{% if MumbleAccount %}
{% if IsAdmin %}

Loading…
Cancel
Save