-
30 Sep 2009 3:49 AM #1
Accessing a form created using xtype, from a button
Accessing a form created using xtype, from a button
hey all,
i have a form that i am using within my panel , i have used xtype in order to create this form, i wish to now submit this form via button,but since i dont have a variable to which my form is assigned i cant use var_name.getForm().submit(), can someone please tell me what i can do now . my code is as follows:
items:[{thanks and regards,xtype:'form',
url:'/kohana/index.php/manage/get_violations',
title:'Reporting',
height:300,
anchor:'100%',
bodyStyle:'padding:5px;',
defaultType:'textfield',items:[{}]
xtype:'combo',
name:'site',
fieldLabel:'Site',
store: store,
displayField:'site',
mode:'local',
width:94
},
{
xtype:'datefield',
fieldLabel:'Start Date',
name:'sdate'
},{
xtype:'datefield',
fieldLabel:'End Date',
name:'edate'
},{
xtype:'combo',
name:'show_violations',
mode:'local',
store:new Ext.data.SimpleStore({
fields:['violations'],
data:[['Completed'],['In Progress'],['All']]
}),
displayField:'violations',
width:94,
fieldLabel:'Violations'
},
{
xtype:'button',
text:'Submit',
handlers:function(){
// want to submit my form from here
// how do i access this form
}
iceLast edited by adibhagra; 5 Oct 2009 at 2:35 AM. Reason: For sake of clarity
-
30 Sep 2009 4:16 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
you can use itemId, look at the API for Ext.Container

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
30 Sep 2009 5:47 AM #3
using itemId
using itemId
i tried this , here 'myForm' is my itemId , but i get the error on firebug saying that Ext.getComponent is not a function. i tried even Ext.FormPanel.getComponent('myForm') but even then its the same response. can you please mention how to use getCompoent.
{
xtype:'button',
text:'Submit',
handler:function(){
console.info('hi');
Ext.getComponent('myForm').submit({
success:function(f,a){
Ext.Msg.alert('Thanks','Finally');
}
})
}
thanks and regards,
ice
-
1 Oct 2009 10:28 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Ext.getCmp

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
4 Oct 2009 10:50 PM #5
Ext.getCmp("myForm") is undefined
Ext.getCmp("myForm") is undefined
hey ,
i tried out Ext.getCmp , but even then it doesn t work.(it says Ext.getCmp is undefined)
any idea what should be done now,
regards,
ice
-
5 Oct 2009 4:04 AM #6Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
That's impossible. Are you using Ext 1.x?

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
5 Oct 2009 9:07 AM #7
-
5 Oct 2009 9:17 AM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Well, you're posting in a version 3.0 forum!
That said, xtypes are not supported in 1.x
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.


Reply With Quote