Ich habe eine Schaltfläche, die ein verstecktes Formular erstellt und ruft form.dom.submit() auf klicken. Ich muss eine Rückrufaktion für Erfolg und Misserfolg hinzufügen, um eine Aktion zu senden. Hier ist der Code:ExtJS 4: Hinzufügen von Erfolg/Misserfolg Callbacks zu form.dom.submit() Aktion
Ext.define("DownloadButton", {
extend: 'Ext.button.Button',
download: function (me, event) {
this.form.dom.submit();
},
initComponent: function() {
this.handler = Ext.Function.bind(this.download, this.scope || this);
this.callParent(arguments);
},
afterRender: function() {
this.callParent(arguments);
this.form = this.getEl().createChild({
tag: 'form',
cls: 'x-hidden',
method: 'POST',
action: this.fileUrl,
target: this.getId() + '-form-iframe'
});
this.getEl().appendChild(this.form);
}
});
Haben Sie versucht params hinzufügen
this.form.dom.submit({
success: function(response) {
console.log('success');
},
failure: function(response) {
console.log('failure');
}
});
einreichen Aber das half nicht.
Können Sie erstellen Beispiel Geige dafür? kann das Problem dort lösen. –
Gibt es einen Grund, das Formular zu verwenden? Welche Daten senden Sie? – MarthyM