2 Replies Latest reply on May 21, 2009 12:02 PM by rnes

    label as item renderer


      I am having trouble with creating a datagrid with sortable columns and cells with selectable text. To get the selectable cells, I extended the Label component and set selectable=true. This works fine, except when a column is sorted by clicking on the title - at that point the selected cell moves to a different position in the column and sometimes the text in it changes. This is due to Flex reusing visible item renderer objects, so the solution is to unselect text when new data is assigned. How can I do this?


      I think the solution starts by overriding the "data" property setter on the custom label, and either there or later on in the rendering process to call "this.textField.setSelection(0,0)". However, this does not seem to work.


      Thanks for any help.