Skip navigation
gaurav97
Currently Being Moderated

need three radio buttons in three different columns of a data grid acting as part of a group.

Jul 11, 2013 3:45 AM

Also they must retrieve and update their selected values to an arraycollection !

 
Replies
  • Currently Being Moderated
    Jul 19, 2013 6:41 AM   in reply to gaurav97

    You can create a different itemRenderer for columns, that will be include RadioButton.

    It will be look something like that:

     

    <?xml version="1.0" encoding="utf-8"?>

    <s:GridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                      xmlns:s="library://ns.adobe.com/flex/spark"

                                                      xmlns:mx="library://ns.adobe.com/flex/mx" clipAndEnableScrolling="true">

              <fx:Script>

                        <![CDATA[

     

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

                                  {

                                            super.data = value;

     

                                            if (value)

                                            {

                                                      radio.selected = Boolean(value.someData);

                                                      radio.groupName = "radioGroup" + this.rowIndex;

                                            }

     

                                  }

     

                                  protected function radio_changeHandler(event:Event):void

                                  {

                                            // TODO Auto-generated method stub

                                            data.someData = radio.selected;

                                  }

     

                        ]]>

              </fx:Script>

     

              <s:RadioButton id="radio" change="radio_changeHandler(event)" />

     

    </s:GridItemRenderer>

     

    And all radiobuttons in each row will work in separatly group.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points