PDA

View Full Version : Composite field is not working



sachin sachdeva
28 Jan 2011, 12:22 AM
hello here is the code that i am using for composite field but it always displays an error message.......but when we remove composite field it works fine
ERROR


Error: b[d.xtype || e] is not a constructor
Source File: http://localhost:8080/amp/assets/lib/ext/ext-all.js
Line: 7



CODE




var checkinForm = new Ext.FormPanel( {
standardSubmit : true,
url : 'checkinResult.jsp',
frame : true,
bodyStyle : 'height:440px;',
defaultType : 'textfield',
autoWidth : true,
fileUpload : true,
monitorValid : true,
labelWidth : 102,
autoRegion : true,
height : 450,
defaults : {
// allowBlank : false,
width : 250
},
items : [ {
html : "<b>Fill the required fields to check in<b><br /><br />",
xtype : "panel"
}, {
fieldLabel : 'Title<span style="color:red">*</span>',
name : 'title',
id : 'title',
allowBlank : false
}, {
fieldLabel : 'Folder Selected<span style="color:red">*</span>',
name : 'folder',
value : foldername,
readOnly : true,
disabled : true,
allowBlank : false
}, new Ext.form.ComboBox( {
editable : false,
typeAhead : true,
triggerAction : 'all',
lazyRender : true,
mode : 'local',
selectOnFocus : true,
emptyText : 'Select the Security Group...',
store : secGroupTypeStore,
valueField : 'myId',
fieldLabel : 'Security Group<span style="color:red">*</span>',
name : 'securityGroup',
displayField : 'displayText',
allowBlank : false
}), {
xtype: 'compositefield',
fieldLabel: 'Date Range',
msgTarget : 'side',
anchor : '-20',
defaults: {
flex: 1
},
items: [
{
xtype: 'datefield',
name : 'startDate'
},
{
xtype: 'datefield',
name : 'endDate'
}
]
},......
.....
.....

.....

dduffy
28 Jan 2011, 2:57 AM
what EXTJS version is being used?

fay
28 Jan 2011, 4:22 AM
Use ext-all-debug.js and FireFox+FireBug while developing/debugging.

valititi
28 Jan 2011, 4:35 AM
some others ideas :
1. have your tried to see if using 'starDate' and 'endDate' directly in your panel (not worry about layout here) works ?

2. defaults: { flex: 1},
flex what ? when you "flex" you flex at least 2 things ! and anyway there are alternatives to flex... stretch, fit, size in % applied to styles, etc...