Solved

Adding event listener to datagrid column

Posted on 2011-09-26
6
386 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

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…
Facebook has became the #1 social media platform. People share many funny videos there, yet you don't know how to download them? Now you can download Videos from Facebook in just 3 simple steps.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

696 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