• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

how to control item in List

New Here ,
Aug 26, 2014 Aug 26, 2014

Copy link to clipboard

Copied

when i create new item in list , how to focus or select the new item was created .

Here my code

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

<!-- dpcontrols\sparkdpcontrols\SparkBBarSimpleModDP.mxml -->

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

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

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

    <s:layout>

        <s:VerticalLayout/>

    </s:layout>

   

    <fx:Script>

        <![CDATA[

            // Add data item, and button, to the List.

            private function addFlexToDP():void {

                myBB.dataProvider.addItem("Flex");

                addFlex.enabled=false;

               

                // how to select or focus to new item created

            }

       

        ]]>

    </fx:Script>

   

    <s:List id="myBB"> 

        <mx:ArrayCollection>

            <fx:String>Flash</fx:String>

            <fx:String>Director</fx:String>

            <fx:String>Dreamweaver</fx:String>

            <fx:String>ColdFusion</fx:String>

        </mx:ArrayCollection>

    </s:List>

   

    <s:Button id="addFlex" label="Add Flex"

              click="addFlexToDP();"/>

   

</s:Application>

Views

179

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines