Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Adding event listener to datagrid column

Posted on 2011-09-26
6
Medium Priority
?
395 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 1600 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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 29

Assisted Solution

by:dgofman
dgofman earned 400 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

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…
An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

647 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