PDA

View Full Version : CellEditing : How to access editors in a row



nikhilkrishnan
4 Nov 2011, 8:48 PM
Hi,

I have gridpanel with cellEditing plugin. The users can add row dynamically and are allowed to set Delivery date ,Start Date, and End Date. Both Start date and End Dates will disabled by default. I want to enable the start date field when the user select delivery date and set the minimum date greater than or equal to selected delivery date . How can i implement this ? I have done this using a normal form but not in a grid .....


{
xtype: 'gridpanel',
id:'contentOrder_grid',
store: tList_store,
height: 525,
title:'TList',
columns: [{xtype: 'rownumberer', text:'SI',width:30},
{
text : 'TName',
sortable : true,
dataIndex: 't_name',
flex:1
},
{
text : 'Delivery Date',
sortable : true,
allowBlank:false,
dataIndex: 'delivery_date',
renderer:function(v){
return (v && isValidDate(v))?Ext.Date.format(v,'d-M-Y'):v;
},
editor: {
xtype: 'datefield',
format : 'd-M-Y',
listeners:{
focus: function(showPicker) {
showPicker.onTriggerClick();
},
'select':function(){
}
}
}
},{
text : 'Start Date',
sortable : true,
allowBlank:false,
dataIndex: 'start_date',
renderer:function(v){
return (v && isValidDate(v))?Ext.Date.format(v,'d-M-Y'):v;
},
editor: {
xtype: 'datefield',
format : 'd-M-Y',
disabled:true,
listeners:{
focus: function(showPicker){
showPicker.onTriggerClick();
}
}
}
},{
text : 'End Date',
sortable : true,
allowBlank:false,
dataIndex: 'end_date',
renderer:function(v){
return (v && isValidDate(v))?Ext.Date.format(v,'d-M-Y'):v;
},
editor: {
xtype: 'datefield',
disabled:true,
format : 'd-M-Y',
listeners:{
focus: function(showPicker){
showPicker.onTriggerClick();
}
}
}
},{
text:'product_id',
flex:1,
dataIndex:'screen_id',
hidden:true
}],
tbar: [{
itemId: 'rt',
text: 'Remove t',
iconCls: 'remove',
handler: function() {
}

}]
,plugins: [cellEditing]
}

I have posted a question in 'Discussions' but didn't get any response yet...

mitchellsimoens
5 Nov 2011, 6:00 AM
You are using CellEditing so there is only one editor at one time. You can get the value of a cell by going to the Store and getting the record. If you want to start editing on a cell based on another cell the CellEditing plugin has a startEdit and startEditByPosition methods.