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

  • SEARCH
  • Home
  • 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 6002155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:56:12+00:00 2026-05-23T00:56:12+00:00

Let’s say I have a data grid and there’s a method attached to clicking

  • 0

Let’s say I have a data grid and there’s a method attached to clicking on any item in a row of the grid. Now, some of the items in the table row are also buttons. Each of these are associated with a different action. We only want one of these actions to be performed. Here is some sample code:

<mx:DataGrid id="dataGrid" dataProvider="{data}" itemClick="selectRow()">
    <mx:columns>
        <mx:DataGridColumn dataField="name" />
        <mx:DataGridColumn id="choose" headerText="Make a choice">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox>
                        <renderers:MyButton label="Choose Wisely" click="{outerDocument.choiceMade()}"/>
                    </mx:VBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
    </mx:columns>
</mx:DataGrid>

My question is:

When the user selects a button item in the row, both methods (selectRow & choiceMade) are executed. Since both methods are
executed, is the order of both fixed
somehow? Is the button method (choiceMade) always
fired before the row method (selectRow), is it
the other way around, or are they
both executed asynchronously?

The thing I’m questioning is that we have currently a member variable to track which selection was made and to ignore the the contents of the other method (the else portion of the method resets this value). Now, if the methods just happen to execute in a different order (or at the same time), the behavior will be unpredictable.

I don’t have a good handle on how all this works so any light you can shed on how Flex fires these methods will be appreciated. Is the member variable flag the way to do this (it smells so bad)?

  • 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-05-23T00:56:13+00:00Added an answer on May 23, 2026 at 12:56 am

    Both events will be dispatched and it will happen pretty much at the same time. You really shouldn’t count on an execution order when working with events. That’s not very good practice.

    As for your specific problem, you can do this:

    <renderers:MyButton label="Choose Wisely" 
                        click="event.stopImmediatePropagation(); 
                               outerDocument.choiceMade()" />
    

    It will stop the click event from propagating through the displaylist and so the datagrid will not receive an itemclick event. The selectrow() method will not be executed when you click on the button.

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

Sidebar

Related Questions

Let's say I have data structures that're something like this: Public Class AttendenceRecord Public
Let's say I have a class that has a member called data which is
Let's say you have a form with a component that displays data from a
Let's say we have a solution with the following structure: Project.DAL - Data access
Let's say I'm building a data access layer for an application. Typically I have
Alright. So I have a very large amount of binary data (let's say, 10GB)
Let say that I have a website with some information that could be access
let say i have one table, which have data like: name status bob single
Let's say I have two data sets. I have a week-by-week tally of users
Let's say I have this data 4 1 4 0 4 1 3 0

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.