Adobe Flex

 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me



Go Back   Tutorialized ForumsWeb Design & DevelopmentAdobe Flex

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Tutorialized Forums Sponsor:
  #1  
Old June 16th, 2011, 05:46 PM
bon_t bon_t is offline
Registered User
Tutorialized Newbie (0 - 499 posts)
 
Join Date: Jul 2010
Posts: 25 bon_t User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 51 m 26 sec
Reputation Power: 0
How to get value of "selected" column in AdvancedDataGrid

Hi All,

I'm using an AdvancedDataGrid component in ActionScript 3, Flex 4.

The grid has 5 columns: Caller Intent, Labels, Strategy, Confirmation Mode, and Confirmation Promptlet. All columns are editable except for the Labels column.

I associated the following method to the itemClick event:

Code:
protected function adgGrid_itemClick( event:Event ):void {
	adg_mappedTagsList.selectedCells;
	if ( adg_mappedTagsList.selectedItems.length == 1 ) {
		if ( adg_mappedTagsList.selectedItem != null ) {
			// User selected another row.
			if ( previousCallerIntentId != adg_mappedTagsList.selectedItem.id ) {
				clickCount = 0;
				previousCallerIntentId = adg_mappedTagsList.selectedItem.id;
			}
		}
	}
									
	// Edit is allowed only when count is greater than 1.
	clickCount++;
	// Need to update the details display when both a single row is clicked or when multiple rows are selected.
	adg_mappedTagsList_itemClickHandler();
}


So when the user single-clicks on a row, the row is just selected, and corresponding data in other panels is fetched. When the user single-clicks again on a cell in this selected row, then that cell goes into Edit mode.

I've noticed the following behaviour:
1. I single-click on a row, the row is selected, no cell is in Edit mode yet.
2. Which cell I clicked on (not counting the Labels cell) determines the number of Tabs that is required to get me to the first cell in the next row.
3. For example, if I clicked in the first column (Caller Intent), it would take 4 Tabs to get to the first cell in the next row (remember that the Labels cell is uneditable).
4. If I clicked in the last/fifth column (Confirmation Promptlet), it would take only 1 Tab to get to the first cell in the next row.
This leads me to believe that the "selected" column is known even though the cell is not in Edit mode.

I have a requirement to put the cell that was clicked on in a selected row into Edit mode if the user presses F2.

The selectedIndex of the grid indicates the selected row. However, I can't seem to find an equivalent for the selected column. I see that there is a selectedCells array. I tried to figure out how this is used, but it seems that columnIndex always remains -1 no matter which column I click in. Only the rowIndex changes.

Thanks for your guidance,
Bonnie

Reply With Quote
Reply

Viewing: Tutorialized ForumsWeb Design & DevelopmentAdobe Flex > How to get value of "selected" column in AdvancedDataGrid


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.

© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap