funnyfox
21 Sep 2012, 9:20 AM
Hi
I have a grid with 5 columns
I want to set a variable whenever some change has happened on any column.
The doubleClick event is firing, but I cannot get keypress/keydown event.
Can anyone help me
Ext.define('tz.ui.BillingRateGrid', {
extend : 'Ext.grid.Panel',
height : 350,
width : '100%',
initComponent : function() {
var me=this;
var flag='notdirty';
this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 2
});
this.columns = [ {
text : 'Name',
width:300,
dataIndex : 'name',
tabIndex:0,
//I want to set the flag when a key is pressed on the item/ when the data is changed
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
allowBlank: false
}
},
{
text : 'Rate',
width : 200,
dataIndex : 'rate',
renderer: 'usMoney',
value : 0,
tabIndex:1,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
xtype: 'numberfield',
allowBlank: false,
minValue: 0,
maxValue: 100000
}
} ,
{
text : 'Start Date',
width : 100,
dataIndex : 'startDate',
xtype: 'datecolumn',
format:'m/d/Y',
tabIndex:2,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
xtype: 'datefield',
format: 'm/d/y'
}
} ,{
text : 'End Date',
width : 100,
dataIndex : 'endDate',
xtype: 'datecolumn',
format:'m/d/Y',
tabIndex:3,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
xtype: 'datefield',
format: 'm/d/y'
}
},{
text : 'Comments',
width:250,
dataIndex : 'comments',
tabIndex:4,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
allowBlank: true
}
} ];
I have a grid with 5 columns
I want to set a variable whenever some change has happened on any column.
The doubleClick event is firing, but I cannot get keypress/keydown event.
Can anyone help me
Ext.define('tz.ui.BillingRateGrid', {
extend : 'Ext.grid.Panel',
height : 350,
width : '100%',
initComponent : function() {
var me=this;
var flag='notdirty';
this.cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 2
});
this.columns = [ {
text : 'Name',
width:300,
dataIndex : 'name',
tabIndex:0,
//I want to set the flag when a key is pressed on the item/ when the data is changed
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
allowBlank: false
}
},
{
text : 'Rate',
width : 200,
dataIndex : 'rate',
renderer: 'usMoney',
value : 0,
tabIndex:1,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
xtype: 'numberfield',
allowBlank: false,
minValue: 0,
maxValue: 100000
}
} ,
{
text : 'Start Date',
width : 100,
dataIndex : 'startDate',
xtype: 'datecolumn',
format:'m/d/Y',
tabIndex:2,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
xtype: 'datefield',
format: 'm/d/y'
}
} ,{
text : 'End Date',
width : 100,
dataIndex : 'endDate',
xtype: 'datecolumn',
format:'m/d/Y',
tabIndex:3,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
xtype: 'datefield',
format: 'm/d/y'
}
},{
text : 'Comments',
width:250,
dataIndex : 'comments',
tabIndex:4,
listeners: {
dblClick: function(field, value) {
me.flag='dirty';
}
},
editor: {
allowBlank: true
}
} ];