Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

calling itemEditEndHandler from a function

Posted on 2011-09-07
4
Medium Priority
?
575 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
[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
  • 2
4 Comments
 
LVL 29

Accepted Solution

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

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…
In this article, I’ll show how research, determination, and use of modern technology helped me solve a DNA mystery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

715 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