Solved

Adding event listener to datagrid column

Posted on 2011-09-26
6
380 Views
Last Modified: 2012-05-12
hi guys

I want to add an event listener to a datagrid column but it doesnt seem to work
My code:

public class TradeGrid extends VBox implements IComponent
{
private function buildColumnModel(complexheaders:Object,fields:Object):void{
//This works
dataGrid.addEventListener(flash.events.KeyboardEvent.KEY_UP,populate);// works fine
}

private function createColumn(columnIndex:int,fieldObject:Object):AdvancedDataGridColumn{
var column:AdvancedDataGridColumn = new AdvancedDataGridColumn();
column.addEventListener(flash.events.KeyboardEvent.KEY_UP,populate);// Does not work
return column;
}

private function populate(event: flash.events.KeyboardEvent) : void {      
PopUpManager.addPopUp(LookUp.dataGrid, this, false); //popup the grid            
         }
}      

Any ideas?

Thanks
0
Comment
Question by:royjayd
  • 3
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
petiex earned 400 total points
ID: 36602131
DataGridColumn just doesn't dispatch any Keyboard events. In fact, the only events it dispatches are flash.events.Event.ACTIVATE and flash.events.Event.DEACTIVATE, which it inherits from EventDispatcher. The reason that DataGrid does dispatch Keyboard events is because it inherits them from InteractiveObject.

I haven't tested this, but it might be that column.itemRenderer.addEventListener(KeyboardEvent.KEY_UP,populate); might work?
0
 

Author Comment

by:royjayd
ID: 36602151
thx for responce
>>column.itemRenderer.addEventListener(KeyboardEvent.KEY_UP,populate);

says access of undefined property addEventListener

 
0
 

Author Comment

by:royjayd
ID: 36672950
Experts,

Any idea if this is possible?

Thx.
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 29

Assisted Solution

by:dgofman
dgofman earned 100 total points
ID: 36712628
Why you cannot add ebent listener inside ItemRenderer what the problem?
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36712644
And why you call your class as TradeGrid and extended from VBox instead DataGird?

public class TradeGrid extends VBox
0
 
LVL 29

Expert Comment

by:dgofman
ID: 36712657
I need full code to understad what are you doing????
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
Cloud-based technologies and services will continue to grow in popularity in 2017 thanks to the simple, scalable and cost-effective solutions they deliver. Here are three areas where cloud adoption is poised to really take off.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now