I figured out what I had wrong, in case anyone else has attempts the same thing here is my code the error was in the if(dataFields[i] == 'EVENT_DESCRIPTION'){
import com.jpmc.ctrbs.dashboard.alarms.renderers.NonEditableTextInputEditor;
if(dataGridColumn.dataField == "EVENT_DESCRIPTION") {
dataGridColumn.editable = true;
dataGridColumn.itemEditor = new mx.core.ClassFactory(NonEditableTextInputEditor);
}
else {
dataGridColumn.editable = false;
}
Here is the NonEditableTextInputRender.mxml that allows the end user to copy the text but not alter it in any other manner and only for one column in the advanced data grid.
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
horizontalScrollPolicy="off">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.FlexEvent;
[Bindable]
public var text:String = "";
override public function set data(value:Object):void {
super.data = value;
else if(value && value.EVENT_DESCRIPTION ) {
try {
textInput.text = value.EVENT_DESCRIPTION;
text = value.EVENT_DESCRIPTION;
textInput.selectionBeginIndex = 0;
textInput.selectionEndIndex = text.length;
textInput.selectRange(0,text.length);
}catch(err:Error) {
}
}
}
protected function textInput_clickHandler(event:MouseEvent):void
{
else if(data && data.EVENT_DESCRIPTION) {
try {
textInput.text = data.EVENT_DESCRIPTION;
text = data.EVENT_DESCRIPTION;
textInput.selectionBeginIndex = 0;
textInput.selectionEndIndex = data.EVENT_DESCRIPTION.toString().length;
textInput.selectRange(0,data.EVENT_DESCRIPTION.toString().length);
}catch(err:Error) {
}
}
}
]]>
</fx:Script>
<mx:TextInput id="textInput" editable="false" doubleClick="textInput_clickHandler(event)" maxChars="1000" />
</mx:Canvas>