How can I get the meta.attr of a cell on the BeforeEdit GridPanel event?
Printable View
How can I get the meta.attr of a cell on the BeforeEdit GridPanel event?
meta.attr is temporary object, it doesn't accessible after cell rendering
Ok. I think I found a way to get what I wanted. I was after the style setting that I made during the renderering..
I wanted to make sure "greyed out" cells couldn't be edited..here is how I got it to work..
Code:var checkForEnable = function (grid, rowIndex, columnIndex, e) {
var t = e.getTarget();
// value will be "background-color: rgb(219, 219, 219); color: black; " if background was set to grey by init rendering.
//we simply cancel the edit event and let user know they can't edit transactions
//for this month since there are no returns.
if (t.style.cssText.indexOf('219') > 0) {
Ext.Msg.alert('No Transactions permitted', 'You can\'t enter transactions for a fund when there are no returns.');
return false;
}
else
return true;
};