Solved

Adding event listener to datagrid column

Posted on 2011-09-26
6
383 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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Flex organization chart 5 615
enable compression/gzip on oracle XML DB HTTP Server 3 568
Automatic Notifications 16 344
Vertical ScrollBar on RichTextArea 2 1,083
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…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

840 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