PDA

View Full Version : Column Editor which is having panel doent get values



Kannan K
3 Sep 2012, 12:17 AM
Hi,
I have the requirement says, the 'Row Editable grid' column should have 'Textfield and Image' together in the same cell. But when I submit the edited row, I am getting java script error in ext-all.js method of 'validateEdit' functionality.
I have attached the code below for the reference.

columns: [{
text: 'Start/End Time',
width: 185,
flex: 1,
sortable: true,
dataIndex: 'startEndTime',
editor: {
xtype:'panel',
//style:"margin-top:30px;",
items:[{
border:false,
style:'margin-top:10px;',
items: [
{
xtype: 'textfield',
id:'scStart',
fieldLabel: 'Start:',
style:'width:10px;float:left;padding-left:10px;',
labelStyle:'padding-left:16px;font-weight:normal;',
name: 'startTime',
labelAlign:'left',
labelWidth: 45,
width: 144,
height:20,
labelSeparator:''
},{
xtype : 'image',
src: 'images/gridContent/btn_datetime.png',
height:20,
//width : 34,
style:"cursor: hand",
}
}
}

Question No 1: Whether we can add the 'panel [which is having Text field and image]' inside the column editor?
Question No 2: If yes, whether we can override the validateEdit functonality which is in ext-all.js to avoid the script error?

scottmartin
5 Sep 2012, 12:37 PM
What is the purpose of having an image in a editor cell?

Scott.

Kannan K
7 Sep 2012, 1:04 AM
The purpose of the image here is to open the Date/Time window once clicked, and the selected date/time will be populated in to its nearest 'text field'.

scottmartin
7 Sep 2012, 5:50 AM
You can simply change the xtype of your field editor to 'datefield'
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.form.field.Date

Scott.