2013-02-07 10:02:00
Topic starter
I have an action whose write mask has certain fields set to be optional so they can be modified in a server-side listener, but on the UI, I want them to be non-editable. How can I do this?
You need to add js-plugin for your view and set editable and editableOverride to false for coulmns you need to have read-only.
You can use columnconfig event of report.
Something like this:
,onColumnConfig: function(report, columnCfg){
Ext.each(columnCfg, function(c){
if(c.id == 'TMS$StaticRoute$TmsActive'){
Ext.apply(c,{
editable: false
,editableOverride: false
});
return false;
}
});
}
This can be done with a report plugin by adding a handler to One.Report's actionstarted event. From there you can modify the fieldInfo array which holds the write mask for the action. Here's an example of how you might do it:
for(var i = 0; i < actionInfo.fieldInfo.length; ++i) {
var field = actionInfo.fieldInfo[i];
if(field.name == 'MOD$Model$Field') {
field.mask = 'IGNORED';
break;
}
}