Note that there are some explanatory texts on larger screens.

plurals
  1. POItemRenderer shows through ItemEditor
    primarykey
    data
    text
    <p>On an mx:datagrid, I use custom itemrenderer and itemeditor. When cell is on edit mode, Itemeditor separator is visible inside itemeditor.</p> <p>So it isn't beautiful, and difficult to read what you write.</p> <p>On itemEditor, I try to use contentBackgroundColor and overriding updateDisplayList</p> <p>See below all code for itemEditor</p> <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:MXDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusEnabled="true" creationComplete="mxdatagriditemrenderer1_creationCompleteHandler(event)" focusIn="mxdatagriditemrenderer1_focusInHandler(event)"&gt; &lt;fx:Script&gt; &lt;![CDATA[ import fr.util.UtilString; import mx.controls.DataGrid; import mx.controls.dataGridClasses.DataGridColumn; import mx.controls.listClasses.BaseListData; import mx.core.FlexGlobals; import mx.core.UITextField; import mx.events.FlexEvent; public var htmlModif:String; public var beginIndex:int; public var endIndex:int; protected override function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void { graphics.beginFill(0xFFFFFF); // white graphics.drawRect(0, 0, unscaledWidth, unscaledHeight); graphics.endFill(); super.updateDisplayList(unscaledWidth, unscaledHeight); } override public function validateProperties():void { super.validateProperties(); if (listData) { var dg:DataGrid = DataGrid(listData.owner); var column:DataGridColumn = dg.columns[listData.columnIndex]; var htmlText:UITextField = lblData.htmlText as UITextField; } } protected function lblData_focusOutHandler(event:FocusEvent):void { beginIndex = lblData.selectionBeginIndex; endIndex= lblData.selectionEndIndex; } protected function mxdatagriditemrenderer1_focusInHandler(event:FocusEvent):void { lblData.editable=true; } protected function mxdatagriditemrenderer1_creationCompleteHandler(event:FlexEvent):void { //set cursor postion to end lblData.selectionBeginIndex=lblData.htmlText.length; lblData.selectionEndIndex=lblData.htmlText.length+1; lblData.addEventListener(MouseEvent.CLICK,copyGloss_focusInHandler); lblData.setFocus(); } // ajout de terme venant du gloassaire protected function copyGloss_focusInHandler(event:Event):void { if(FlexGlobals.topLevelApplication.copyFromGloss){ if(Clipboard.generalClipboard.hasFormat(ClipboardFormats.TEXT_FORMAT)){ var textCpb:String = Clipboard.generalClipboard.getData(ClipboardFormats.TEXT_FORMAT) as String; var ind:int = new UtilString().calculateHtmlPosition(lblData.htmlText, lblData.selectionBeginIndex); lblData.htmlText = lblData.htmlText.substring(0, ind) + textCpb + " "+lblData.htmlText.substring(ind, lblData.htmlText.length); } htmlModif=lblData.htmlText; Clipboard.generalClipboard.clear(); FlexGlobals.topLevelApplication.copyFromGloss=false; } } ]]&gt; &lt;/fx:Script&gt; &lt;mx:TextArea id="lblData" top="0" left="0" right="0" bottom="0" htmlText="{dataGridListData.label}" wordWrap="true" editable="true" contentBackgroundColor="0xFFFFFF" horizontalScrollPolicy="off" creationComplete="htmlModif=lblData.htmlText" change="htmlModif=lblData.htmlText" focusOut="lblData_focusOutHandler(event)"/&gt; &lt;/s:MXDataGridItemRenderer&gt; </code></pre> <p>Datagrid build</p> <pre><code>&lt;mx:DataGrid id="dgSuiviClini" verticalGridLines="true" horizontalGridLines="true" horizontalScrollPolicy="on" variableRowHeight="true" dataProvider="{DP_LISTEREDVCLI}" editable="true" focusEnabled="true" dropEnabled="true" itemEditBegin="dgSuiviClini_itemEditBeginHandler(event)" itemEditEnd="getCellInfo(event);" itemFocusOut="getCellInfo(event)" width="100%" height="100%" rowHeight="20"&gt; &lt;mx:columns&gt; &lt;mx:DataGridColumn dataField="scRub2" headerText="{sNomCol2}" editable="true" width="{iNomCol2}" id="dgc1" wordWrap="true" visible ="{bcol2Visible}" itemRenderer="fr.ui.itemRenderer.MultilineHTMLRenderer" itemEditor="fr.ui.itemRenderer.irCliHtmlEditor" editorDataField="htmlModif" editorUsesEnterKey="true" /&gt; &lt;/mx:columns&gt; &lt;/mx:DataGrid&gt; </code></pre> <p>But in those cases the result is like that: <img src="https://i.stack.imgur.com/LgPwA.jpg" alt="enter image description here"></p> <p>I'm very happy if you could hep me.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload