Solved

calling itemEditEndHandler from a function

Posted on 2011-09-07
4
558 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

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

Title # Comments Views Activity
Flash player stream to ipad: is that possible ? 4 529
Flex Mobile: Get Gps Coordinates 6 1,351
How to export vector graphics from Actionscript 3.0 SWF? 4 1,190
Play RTMP without Flash 3 517
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…
Employees depend heavily on their PCs, and new threats like ransomware make it even more critical to protect their important data.
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

808 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