1 Reply Latest reply on Jan 3, 2012 5:23 AM by kmkarthic

    Issue with adding label to <s:HGroup>

    kmkarthic

      Hi All,

       

      I've reqmt to diplay a column which takes multiple values seperated by coma like abc,def,ghi etc. And when mouse is hovered over each value the corresponding description shuld come in a tootltip.

      I guess there is some problem in addElement method. Right now empty values are displayed.

       

       

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

          _data = value;

          if(_data!=null){

           if(column.dataField == "XXXX"){

            _dataArrCollection = _data[column.dataField];

          

            var featureLabel:HGroup = new HGroup();

          

          

            var lblDots:Label = new Label();

            lblDots.text = "";

            lblDots.toolTip = "";

           

            if(_dataArrCollection != null ){

             for(var i:Number = 0; i < _dataArrCollection.length; i++)

             {

              var lblData:String = StringUtil.trim(_dataArrCollection[i]["featureCode"]);

              if(i < (_dataArrCollection.length - 1))

              {

               lblData += ",";

              }

              var lbl:Label = new Label();

              lbl.text = lblData;

              lbl.toolTip = _dataArrCollection[i]["featureDesc"];

              // this.addElement(lbl);

              featureLabel.addElement(lbl);

              featureLabel.horizontalAlign = "left";

              totalLabels += 1;

              lblDots.toolTip += _dataArrCollection[i]["featureCode"] + " : " + _dataArrCollection[i]["featureDesc"] + "\n";

             }

            }

            //this.addElement(lblDots);

            featureLabel.addElement(lblDots);

            totalLabels += 1; 

           }

          }

         }

       

      When used this.addElement(lblDots) instead of   adding the label to a HGroup element like  featureLabel.addElement(lblDots);, values are getting displayed but overidden (wrapped on) on each other.

       

       

      Any help much appreciated.