Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9211007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:12:03+00:00 2026-06-18T01:12:03+00:00

I want to connect these 3 together. When you choose from the togglebutton bar

  • 0

I want to connect these 3 together. When you choose from the togglebutton bar it will be displayed in the combobox, and from there you can choose other data that will be displayed in the datagrid.

Now I have the first two connected:

private function toggle(event:ItemClickEvent):void{

                list2.selectedIndex=-1; // reset so prompt shows
                if (togglebtn.selectedIndex==0)
                list2.dataProvider=elecItems;
                else if(togglebtn.selectedIndex==1)
                list2.dataProvider=toyItems;

            }

<mx:ToggleButtonBar id="togglebtn" x="9" y="29" color="0x323232" dataProvider="{dp}" horizontalGap="4" itemClick="toggle(event)"/>

<s:ComboBox id="list2" x="159" y="28" width="549" itemClick="select_item(event)"/>

now I want to connect the combobox with the datagrid, but when I use:

if (list2.selectedIndex==0)
info_dg.dataProvider={info};

it directs to two indexes…. anyway I don7t quite understand it myself and hope to get some help.

also instead of using SelectedIndex==0 could I use an ID instead?

Data structure:
ToggleButtonBar

[Bindable]public var dp:ArrayCollection = new ArrayCollection([
            {label:"商品", data:399}, 
            {label:"顧客", data:599}]);

Combobox

[Bindable]public var elecItems:ArrayCollection = new ArrayCollection([
                {label:"text", data:299}, 
                {label:"tttナビ", data:999}, 
                {label:"大学院ttt", data:999}, 
                {label:"ttt", data:999}, 
                {label:"ttt制作", data:899},
                {label:"tttt", data:899}]);


            [Bindable]public var toyItems:ArrayCollection = new ArrayCollection([
                {label:"text", data:120}, 
                {label:"text", data:50}, 
                {label:"text", data:50},
                {label:"(株)text", data:30} ]);

Datagrid XML file:

<fx:XMLList id="Info">
            <employee>
                <name>eeee/完了</name>
                <phone>eee</phone>
                <email>eee制作</email>
                <active>300,000</active>
                <image>eeee</image>
            </employee>
            <employee>
                <name>rrr/完了</name>
                <phone>rrr</phone>
                <email>rrr設営</email>
                <active>1,900,000</active>
                <image>rrrしないように</image>
            </employee>
        </fx:XMLList>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:12:04+00:00Added an answer on June 18, 2026 at 1:12 am

    I have such a structure to save informations about employees

    <fx:XMLList id="info">
            <toggle>
                <group>
                    <employee>
                        <name>ei1_name1</name>
                        <phone>phone1</phone>
                    </employee>
                    <employee>
                        <name>ei1_name2</name>
                        <phone>phone2</phone>
                    </employee>
                </group>
                <group>
                    <employee>
                        <name>ei2_name1</name>
                        <phone>phone1</phone>
                    </employee>
                    <employee>
                        <name>ei2_name2</name>
                        <phone>phone2</phone>
                    </employee>
                </group>
            </toggle>
    
            <toggle>
                <group>
                    <employee>
                        <name>ti1_name1</name>
                        <phone>phone1</phone>
                    </employee>
                    <employee>
                        <name>ti1_name2</name>
                        <phone>phone2</phone>
                    </employee>
                </group>
                <group>
                    <employee>
                        <name>ti2_name1</name>
                        <phone>phone1</phone>
                    </employee>
                    <employee>
                        <name>ti2_name2</name>
                        <phone>phone2</phone>
                    </employee>
                </group>
            </toggle>
    
        </fx:XMLList>
    

    There are two toggle blocks to tell “toy” and “elec” apart.
    Each block has a number of “group” items – each for the corresponding item in the CheckBox.

    If it is ok, then you should not use any “if else”. Instead of it your function would look like

            private function onCbChanged(evt:IndexChangeEvent):void
            {
                info_dg.dataProvider = info[togglebtn.selectedIndex].group[list2.selectedIndex].employee;
            }
    

    The “togglebtn.selectedIndex” selects a toggle block and the “list2.selectedIndex” selects a group of the toggle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Specifically, I have a list of points. I want to connect these points together
Is there is any way to connect multiple UIButtons to one IBOutlet? I want
I want to connect from home using SQL Server 2005 to another PC. I
I want to connect to DB2 from excel macro...This is my code, but it
I want to connect my log4j.xml with log4j.xsd (xml schema). Project don't have any
I want to connect my rails 3 application to firebird database. I have followed
I want to connect a single ForeignKey to two different models. For example: I
I want to connect to a URL with the socket method ( http://msdn.microsoft.com/en-us/library/system.net.sockets.socket(v=VS.96).aspx );
i want to connect database to iphone sdk but it is taking the default
In my application I want to connect SQL Server Express with Hibernate. But I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.