2 Replies Latest reply on Jan 12, 2012 8:39 AM by Abhishek Chaudhary

    Re-usable Item-renderers

    Abhishek Chaudhary

      Can we create re-usable item renderers in flex?


      Like If I have 10 datagrids having different dataproviders


      I want to display any one column in every datagrid as a link button, can I do it using only one item renderer?




        • 1. Re: Re-usable Item-renderers
          Abhishek Chaudhary Level 1

          Can anyone plz reply....

          • 2. Re: Re-usable Item-renderers
            Abhishek Chaudhary Level 1

            Wel no one replied..


            I got answer and posting same..








            package com.nol.atplan.reportresult.view


                      import flash.events.MouseEvent;


                      import mx.containers.HBox;

                      import mx.controls.CheckBox;



                      public class CheckBoxRenderer extends HBox {



                       private var selectedItem:Object;

                       private var chbox:CheckBox;


                       public function CheckBoxRenderer() {


                                chbox = new CheckBox();




                       override public function set data(value:Object):void{

                                selectedItem = value;

                                if(value!=null) {

                                      if(value.Flag == false) {


                                      } else if(value.Flag == true) {












            ////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////

            objCol is advanced datagrid col !!


            var colRendererFactory:ClassFactory = new ClassFactory(lnBtnItemRenderer);

                                                              colRendererFactory.properties={columnName:datagridDetails[i].hea derText};