PDA

View Full Version : Hide rowcontextmenu on particular cells in a Editor grid



9 Oct 2009, 9:19 AM
Hello everyone,

I have a editor grid panel and I have a rowcontextmenu listener defined as below


listeners: {
rowcontextmenu: function(grid, rowIndex, e){
e.stopEvent();
currentRecord = grid.getStore().getAt(rowIndex);
gridPanel.getSelectionModel();
var xy = e.getXY();
contextMenu.showAt(xy);
}
}
I have a column called 'ENDITEM' defined in the columnmodel definition.I am using a renderer for this column so that it show blank space if the value is same as the previous row's value.

Here is the renderer for the column 'ENDITEM'



{
header: "<b>End Item</b>",
width: 200,
dataIndex: 'ENDITEM',
align: 'center',
renderer: function(value, metaData, record, rowIndex){
if ((rowIndex > 0 && value == dsGrid.getAt(rowIndex - 1).get('ENDITEM'))) {
return '';


}
else {
return '<div class="vv-description">' + '<span><h3>' + value + '</h3>' + '<i>' + record.data.DESC1 + '</i>' + '</span></div>';
}
}
}

I do not want show rowcontextmenu for this column if the value is empty and I also want to know how do we disable the right click on a entire column.Can anybody please help me out here.

Thanks in advance
Sai

9 Oct 2009, 9:59 AM
I tried to inspect Event Object methods but with no success. Can anyone please help me out!!!

Regards
Sai