Using other components in Datagrid

Ask a Question related to Macromedia Flash Actionscript, Design and Development.

  1. #1

    Default Re:Using other components in Datagrid

    Stuet:

    Did you ever figure out how to make the text wrap in a datagrid? I can't figure it out, either! Help!?

    Ken.
    kenreiss Guest

  2. Similar Questions and Discussions

    1. Flash & Datagrid - Extension, Components & Recommendations
      I'm looking at bringing together PHP and flash and I'm currently looking for the best, most reliable, cheapest way to accomplish that. I'm looking...
    2. How to use components
      For example, I draw a combobox, I want to load the certain movie when the change event is triggered. How to do that?
    3. Components Components Components
      Again with the damn component questions.... I am trying to use the accordion box (MX 2004), and would like my text to appear within the different...
    4. To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible?
      Hello, I am searching the whole Internet for a good example how to edit/update a DataGrid in a DataGrid (nested DataGrid). I know how to...
    5. PIA for COM components
      Ken, Thanks for the info Kishore
  3. #2

    Default Re:Using other components in Datagrid

    - Create a new movie symbol and give it the linkageId
    'CellRendererWrapTextSymbol'

    - Put a text field in the symbol at x:0, y:0, name it 'label_txt' and turn on
    the 'multline' text

    - Add this actionscript

    #initclip 1

    function CellRendererWrapTextClass()
    {
    //set the text field height to the height of the row
    this.label_txt._height = this._parent._height
    this.label_txt._x = 1;


    if (this.hostComponent==undefined) {
    this.hostComponent = (this._parent.controller==undefined) ? this._parent :
    this._parent.controller;
    }
    //apply the style from the hostComponent to the text field
    this.textStyle = this.hostComponent.textStyle;
    this.label_txt.setNewTextFormat(this.textStyle);
    }

    CellRendererWrapTextClass.prototype = new MovieClip();

    Object.registerClass("CellRendererWrapTextSymbol", CellRendererWrapTextClass);

    CellRendererWrapTextClass.prototype.setSize = function(w)
    {
    //set the text field width to the width of the column
    this.label_txt._width = w;
    this.label_txt.textWidth = w;

    }

    CellRendererWrapTextClass.prototype.setValue = function(value, selected)
    {
    //only update the text if the value changes
    if (value == undefined){
    this._visible = false;
    } else if (value != this.label_txt.text){
    this.label_txt.htmlText = value;
    this._visible = true;
    }
    }

    CellRendererWrapTextClass.prototype.setFocused = function()
    {
    // also optional. If you want to tab into the cell in editable mode, do this
    up!
    }

    #endinitclip

    - At the grid use this code to set the cell renderer
    myGrid_dg.getColumnAt(x).setCellSymbol('CellRender erWrapTextSymbol')



    dgrigg Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139