PDA

View Full Version : Equivalent function as .getForm().submit in Container



genggeng13
14 Sep 2013, 6:28 AM
I am using Container to hold all the control instead of form , because a container perform much more faster compare to form , correct me if I were wrong , but than is than any equivalent function .getForm().submit for container ?

Thank you

vela1606
14 Sep 2013, 11:02 PM
no, submit() is a method of Ext.form.Basic not Ext.container.Container

ettavolt
15 Sep 2013, 11:14 PM
But you can create Ext.form.Basic around your container.

vela1606
16 Sep 2013, 3:19 AM
ettavolt is right, but unless you have 100+ forms render at ones, you should not have to worry about performance when using Ext.form.Panel.

Here is how Ext.form.Panel uses the Ext.form.Basic

http://docs.sencha.com/extjs/4.2.1/source/Panel2.html#Ext-form-Panel (http://docs.sencha.com/extjs/4.2.1/source/Panel2.html#Ext-form-Panel)

(Not tested) You can copy and paste this above code and change this...


Ext.define('Ext.form.Panel', { //<---- change this to 'Your.Class.Name'
extend:'Ext.panel.Panel', //<---- change this to 'Ext.container.Container'
mixins: {
fieldAncestor: 'Ext.form.FieldAncestor'
},
alias: 'widget.form', //<---- change this to 'widget.containerform'
// alternateClassName: ['Ext.FormPanel', 'Ext.form.FormPanel'], //<---- comment this
requires: ['Ext.form.Basic', 'Ext.util.TaskRunner'],