Hi, we want Formula Fields to display as canEdit:false in List grids. I've tried to figure out how to do this with no luck. It seems like this should be the default setting with perhaps the ability to override and set canEdit:true for the rare instances where someone would want to edit the output of a formula. That would basically make the formula worthless so I would think canEdit:false is a more reasonable default.
I first tried to get a list of grid.completeFields but I didn't see the formula fields in the list. So, the formula fields must be getting added at some point I haven't yet determined from looking at the code.
Here are the patches I tried to force canEdit:false. I can see the formula field getting set to canEdit:false briefly with these patches but it seems to get set back to canEdit:true after setViewState is called on a grid.
So, any suggestions on how to make this happen?
I first tried to get a list of grid.completeFields but I didn't see the formula fields in the list. So, the formula fields must be getting added at some point I haven't yet determined from looking at the code.
Here are the patches I tried to force canEdit:false. I can see the formula field getting set to canEdit:false briefly with these patches but it seems to get set back to canEdit:true after setViewState is called on a grid.
So, any suggestions on how to make this happen?
Code:
isc.FormulaBuilder.getPrototype().addProperties({ getCompleteValueObject:function(){ var _1=this.getUsedFields(),_2=this.generateFunction(),_3={canEdit:false,sortNormalizer:_2,$65w:_2,type:this.fieldType,userFormula:{text:this.getValue(),formulaVars:{}}},_4=this.getFieldIdProperty(); if(this.allowEscapedKeys)_3.userFormula.allowEscapedKeys=true; for(var i=0;i<_1.length;i++){var _6=_1.get(i);_3.userFormula.formulaVars[_6.mappingKey]=_6[_4]} return _3; }, getBasicValueObject:function(){var _1=this.getUsedFields(),_2={canEdit:false,text:this.getValue(),formulaVars:{}},_3=this.getFieldIdProperty();if(this.allowEscapedKeys)_2.allowEscapedKeys=true;for(var i=0;i<_1.length;i++){var _5=_1.get(i);_2.formulaVars[_5.mappingKey]=_5[_3]} return _2}, getUpdatedFieldObject:function(){return isc.addProperties(this.field,{canEdit:false,title:this.getTitle()},this.getCompleteValueObject())} })
Comment