Skip to content

Instantly share code, notes, and snippets.

@PowerKiKi
Created June 17, 2010 16:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PowerKiKi/442370 to your computer and use it in GitHub Desktop.
Save PowerKiKi/442370 to your computer and use it in GitHub Desktop.
Ext.ns("TYPO3.Extjsformsample.UserInterface");
TYPO3.Extjsformsample.UserInterface.MyForm = function() {
TYPO3.Extjsformsample.UserInterface.MyForm.superclass.constructor.call(this, {
id: 'myformid',
title: 'My test form',
defaultType: 'textfield',
items: [{
fieldLabel: 'Name',
name: 'name',
}, {
fieldLabel: 'Email',
name: 'email',
}],
buttons: [{
text: 'Submit',
handler: function(){
Ext.getCmp('myformid').getForm().submit(); // This line seems "over"-complicated ... ?
}
}],
api: {
load: TYPO3.Extjsformsample.Remote.getFormData,
submit: TYPO3.Extjsformsample.Remote.submitFormData
}
});
};
Ext.extend(TYPO3.Extjsformsample.UserInterface.MyForm, Ext.form.FormPanel, {
onRender: function() {
TYPO3.Extjsformsample.UserInterface.MyForm.superclass.onRender.apply(this, arguments);
this.form.load();
}
});
Ext.reg('TYPO3.Extjsformsample.UserInterface.MyForm', TYPO3.Extjsformsample.UserInterface.MyForm);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment