2 Replies Latest reply on Apr 30, 2010 3:07 AM by dhifallah

    showing a list whenn clicking on the cell

    dhifallah

      Hi,

       

      I'm trying insert a list in my datagrid when the usser click on the cell to change it.

      I have an editable column in witch user have to enter numbers (4) separated like this way (aaaa bbbb cccc).==> this part is done and itt works.

      Now I want to insert a list when clicking to enter a number , and user have to choose among this liste of numbers.

      this is my code without the list:

       

      <mx:DataGridColumn headerText="Liste_organisme" dataField="liste_organisme" editable="true" editorDataField="value">

       

      <mx:itemEditor>

       

      <mx:Component>

       

      <mx:HBox>

       

      <mx:Script>

      <![CDATA[

       

      public function get value() : String

      {

       

      return part1.text +("\t")+part2.text+ ("\t")+part3.text+ ("\t")+part4.text;

       

      }

       

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

      {

       

      super.data = value;

      part1.text = value.liste_organisme.slice(0,4);

      part2.text = value.liste_organisme.substr(0,4);

      part3.text = value.liste_organisme.substr(8,4);

      part4.text = value.liste_organisme.substr(12,4);

       

      }

       

       

      ]]>

       

      </mx:Script>

       

       

      <mx:TextInput id="part1" maxChars="4" restrict="0-9" width="40"/>

       

      <mx:TextInput id="part2" maxChars="4" restrict="0-9" width="40"/>

       

      <mx:TextInput id="part3" maxChars="4" restrict="0-9" width="40"/>

       

      <mx:TextInput id="part4" maxChars="4" restrict="0-9" width="40"/>

       

       

      </mx:HBox>

       

       

      </mx:Component>

       

      </mx:itemEditor>

       

      </mx:DataGridColumn>

       

      and the list wich i have to put is:

       

       

       

      <mx:List allowMultipleSelection="true" >

       

      <mx:ArrayCollection>

       

      <mx:String>9001</mx:String>

       

      <mx:String>9007</mx:String>

       

      <mx:String>9010</mx:String>

       

      <mx:String>9011</mx:String>

       

      <mx:String>9910</mx:String>

       

       

      </mx:ArrayCollection>

       

      </mx:List>

       

      can you help me please!

       

      can you help me please!

      can you help me please!

       

       

        • 1. Re: showing a list whenn clicking on the cell
          dhifallah Level 1

          i'm waitting for your help please

          • 2. Re: showing a list whenn clicking on the cell
            dhifallah Level 1

            I tried with this code , but it doesn't work .

            error: 1120: Accès à la propriété non définie list. ==>that's mean list is not knowen

             

             

            <mx:DataGridColumn

             

             

            headerText="Liste_organisme" dataField="liste_organisme" editable="true" editorDataField="value4">

             

             

            <mx:itemEditor>

             

             

            <mx:Component>

             

             

            <mx:HBox>

             

             

            <mx:Script>

            <![CDATA[

             

             

            public function get value4() : String

            {

             

            return partListe1.text +("\t")+partListe2.text+ ("\t")+partListe3.text+ ("\t")+partListe4.text;

             

            }

             

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

            {

             

             

            super.data = value4;

            partListe1.text = value4.liste_organisme.slice(0,4);

            partListe2.text = value4.liste_organisme.substr(4,4);

            partListe3.text = value4.liste_organisme.substr(8,4);

            partListe4.text = value4.liste_organisme.substr(12,4);

            list.setStyle(

            "borderSkin", null);

            }

             

            ]]>

             

            </mx:Script>

             

             

             

            <mx:TextInput id="partListe1" maxChars="4" restrict="0-9" width="40">

             

             

            <mx:itemEditor>

             

             

            <mx:Component>

             

             

            <mx:List id="list" dataProvider="[Red,Orange,Yellow,Green,Blue]" width="50"/>

             

             

            </mx:Component>

             

             

            </mx:itemEditor>

             

            </mx:TextInput>

             

             

            <mx:TextInput id="partListe2" maxChars="4" restrict="0-9" width="40" />

             

             

            <mx:TextInput id="partListe3" maxChars="4" restrict="0-9" width="40" />

             

             

            <mx:TextInput id="partListe4" maxChars="4" restrict="0-9" width="40" />

             

             

             

            </mx:HBox>

             

             

             

            </mx:Component>

             

             

            </mx:itemEditor>

             

             

            </mx:DataGridColumn>