Solved

calling itemEditEndHandler from a function

Posted on 2011-09-07
4
556 Views
Last Modified: 2012-05-12
hi guys

I have a requirment, been trying hard to solve this.

In my appliaction the following functions are called



private function buildColumn(headers:Object,fields:Object):void{
 dataGrid.addEventListener(flash.events.KeyboardEvent.KEY_UP,createAutoPopulate);
dataGrid.addEventListener(AdvancedDataGridEvent.ITEM_EDIT_END,itemEditEndHandler);
            }

private function createAutoPopulate(event: flash.events.KeyboardEvent) : void {      
PopUpManager.addPopUp(dataGrid, this, false);      //show data            
tradeLookUp.dataGrid.addEventListener(CheckBoxEvent.CHECKBOX_TOGGLED,populatedata);
dataGrid.addEventListener(MouseEvent.CLICK,closepopupOnouterGridClick);
}

private function itemEditEndHandler(event:AdvancedDataGridEvent):void{
if(event.currentTarget.columns[event.columnIndex].editable){
..code
   }
}

private function populatedata ( event:CheckBoxEvent ) : void {
soeIdtoDisplay = event != null && event.data != null ? event.data.userId : "";
From here i want to call itemEditEndHandler()  and pass the AdvancedDataGridEvent.
any idea how i can do that?
                  
//AdvancedDataGridEvent evnt =  ??
//      itemEditEndHandler(evnt);
                  
}

 
0
Comment
Question by:royjayd
  • 2
4 Comments
 
LVL 29

Accepted Solution

by:
dgofman earned 500 total points
ID: 36499889
If you are extended an itemRenderer you should able to dispatch and event.
I need full code

var advancedDataGridEvent:AdvancedDataGridEvent =
            new AdvancedDataGridEvent(AdvancedDataGridEvent.ITEM_EDIT_END, false, true);        advancedDataGridEvent.columnIndex = listData.columnIndex;
advancedDataGridEvent.dataField = listData.dataField;
advancedDataGridEvent.rowIndex = listData.rowIndex;
advancedDataGridEvent.itemRenderer = this;
 advancedDataGridEvent.reason = AdvancedDataGridEventReason.CANCELLED;
dispatchEvent(advancedDataGridEvent);

0
 
LVL 37

Expert Comment

by:zzynx
ID: 36527658
>> tradeLookUp.dataGrid.addEventListener(CheckBoxEvent.CHECKBOX_TOGGLED, populatedata);
I find the above instruction looking strange, uncommon: You listen on a DataGrid for CheckBoxEvent's.
No offense meant, but isn't that weird?
Maybe you have to rethink your design. Can you explain it to us?
0
 

Author Comment

by:royjayd
ID: 36529267
>>No offense meant, but isn't that weird?
why?
The datagrid contains a checkbox column. when checkbox in each row is checked or unchecked i am calling populatedata function.
0
 
LVL 37

Expert Comment

by:zzynx
ID: 36529484
I would expect that checking/unchecking the checkbox editor, changes your datagrid data.
That is something you can listen for.
0

Featured Post

Promote certifications in your email signature

Has your company recently won an award or achieved a certification? They'll no doubt want to show it off. Email signature images used to promote certifications & awards can instantly establish credibility with a recipient and provide you with numerous benefits.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Closing FLash Privacy/Video Panel 2 846
how to edit swc file 3 541
Adobe X Reader 6 342
How to create a simple "throw object" gesture on as3 / air mobile ? 3 1,171
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…
Note: This is the second blog post in a series on email clearinghouses (https://www.xmatters.com/alert-management/blog-email-has-failed-us?utm_campaign=70138000000ydLoAAI&utm_source=exex&utm_medium=article&utm_content=blog-post).   Every month t…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

862 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

23 Experts available now in Live!

Get 1:1 Help Now