Flex :: DataGrid ItemEditEnd Event - PreventDefault Function

Jan 13, 2011

I am working with flex's datagrid. I have a DataGridColumn defined as the following, where labelFunction would allow me to display a custom text. I am also using a itemEditEnd handler on the grid to manipulate the entered data for this column. The purpose is to take the user input and split it then store the result in different properties other than "fixedValue". My problem with this approach is that I can't find a way to prevent assignment to the fixedValue property (which doesn't exist).

And using event.preventDefault() in the itemEditEnd handler would stop other events from happening like changing the row from edit mode to the view mode. My question is that if there is other way to achieve the same thing, or a way to just prevent the assignment of the "dataField" data. I am using the dataField to identify the column I am editing. Leaving it null might not be an option.

<mx:DataGridColumn id="columnFixedCurrency" labelFunction="fixedCurrecy_labelFunc" dataField="fixedValue" headerText="Price"/>

View 1 Replies


Similar Posts:


Flex :: Event Like ItemEditEnding Or Any Other Way To Stop Event Before ItemEditEnd Event In Datagrids?

Apr 12, 2011

I have editable grids which are 2-way binded to my model. What I want is to validate my data when user edits any cell before it get updated in model. I have applied my validation at ItemEditEnd handler, but, I want to apply validation in between itemEditBegin and itemEditEnd events.

View 1 Replies

Flex :: Datagrid As Item Editor Gets 'itemEditEnd' Prematurely?

Apr 18, 2011

My application has a tree with a custom item renderer, which depending on the type of data at a leaf uses different components as editors. In one case I am trying to use a datagrid so that the user can choose a row that meets his needs (several columns need to be displayed), ie. similar in concept to a ComboBox.To do this I have a function assigned to be the handler for 'itemEditBegin' (for the tree) in which I'm dynamically creating the datagrid, and then using the popup manager to display it as a (modal) popup. So far so good.

However, if you click anywhere (eg. scroll down button in the datagrid) the popup disappears because the itemEditEnd event is fired - why ?In another scenario, I have a DateField setup as the editor, and the user can click on the icon to bring up a DateChooser, scroll through the months, etc. I looked at the code behind this, and it is using a popup, seemingly in exactly the same way as my code !Here is the 'itemEditBegin' code:

dataGrid = new DataGrid();
dataGrid.dataProvider = mddTable.dataCollection;
dataGrid.editable = false;

[code]......

View 2 Replies

Flex :: Commit New Value From ItemEditor Before ItemEditEnd Event

Sep 7, 2009

I have a DataGrid, with itemEditor as NumericStepper in a few columns. When a value in the DataGrid is edited, I would like to update several values displayed on the screen, and so want to call a updateValues() function.First, I added this function to itemEditEnd event of the DataGrid, but the function is getting called before the new value is updated into the dataProvider and hence, the values I have in the function are the old values. Is there any other event that is fired after the values are updated into the dataProvider? or am I missing something?Second, I tried putting this function in the change event of each itemEditor (duh!), but then again, the change event is fired, but the values in the dataProvider are the old ones.Is there any way I can make the function updateValues() be called, every time a value is edited AND updated into the dataProvider, because there's where I am taking the values from?

View 1 Replies

Flex :: Trigger An ItemEditEnd Event Within The ItemEditor

Sep 29, 2010

This might be an easy one for you DataGrid experts out there. I following an example for adding rows to a DataGrid dynamically from within a row

[URL]

My tweak that I am trying to acoomlish, is to have a custom itemEditor that is a form with two TextInputs and an OK button. For the life of me I can't get that button to trigger the DataGrid's itemEditEnd event where I have some processing before I call destroyItemEditor. I tried dispatching the event myself directly but got a strange error in DataGrid's updateDisplayList saying editedItemPosition was null (editedItemPosition.rowIndex).

View 2 Replies

Trigger ItemEditEnd Event In Flex List When CheckBox Is Checked / Unchecked?

Jun 30, 2009

I have a List component that has drop-in CheckBox itemEditor that also serves as the itemRenderer. It displays each item as a simple CheckBox with a label.

However, the itemEditEnd Event does not get triggered until I click on something outside of the List. I want it triggered once the CheckBox is checked or unchecked.

I was thinking of manually dispatching the ListEvent.ITEM_EDIT_END in a CLICK Event handler, but then the itemEditEnd Event would get dispatched twice. There's gotta be a better way to do this.

View 2 Replies

Flex :: Changing Dataprovider Of A Datagrid On Change Event Of Another Datagrid?

Oct 15, 2011

I have two datagrids:

- Division
- Members

Both have single columns. Selecting one item from Divsions datagrid should display members of that Division in the Members datagrid. But following code has some problem and Members of a particular division do not show up when respective Divsion is clicked.

Following are some snippets of the related code. Hope someone can spot an error in it.

[Code]..

View 2 Replies

Flex :: Air 2.0 On Application Quit, Call PreventDefault?

Nov 12, 2010

Trying to prevent the application from shutting down when clicked the X button, it still closing but the AIR process is running in the task manager. What wrong with the code?

Application Complete: NativeApplication.nativeApplication.addEventListener(Event.EXITING, onExiting);

Closing code:

private function onExiting(e:Event):void
{
e.preventDefault();
}

View 1 Replies

Flex :: Add A Datagrid Row On Key Down Event?

Oct 8, 2009

I have a datagrid with one row intially. When I click on the first row, i.e on key down event, I want another row to be added. Earlier I had a button, on clicking which I added the row. But now I want the row to be added automatically once I click the first row. How to do that?

I added keydown event to the datagrid, but it threw some error.

Can someone help me? I have given my code here. I have a text box and a button in the task component. When I click the text box in the task component, I want the addTaskRow function to be called..

[Code]...

View 2 Replies

Flex :: Event Handler Associated To DataGrid Row?

Jan 16, 2012

I'm loading some images from a database using a PHP script through CodeIgniter, but when I try to add an event handler to do some stuff with these images, Flex compiler is showing me an error:1180: Call to a possibly undefined method cloneCar.Why I can not add an event handler in this context?

<mx:Accordion>
<mx:Form id="menu5" label="Prueba" width="100%" height="100%" backgroundColor="#707070" icon="{roadIcon}">

[code].....

View 1 Replies

Flex :: Itemclick Event In Datagrid?

Jun 9, 2009

The problem can be summarized as when clicking an item in datagrid, the text area shows the value of the item, but here the compoents are separate and hence events need to be dispatched.

[Code]...

View 1 Replies

Flex :: DataGrid Add New Row Via Single Click Event

Apr 15, 2012

Flex data grid has 1 default row created. When user clicks on the second row, a new row needs to be created and made editable.

Here is what works already - user tabs over the columns and when the user tabs while in the last column, a new row is created with default values.

Here is also what already works - user click a button outside the grid, which adds a new row.

(itemEditBegin and itemEditEnd have been implemented)

Here is what does NOT work: When I "single click" on the second row (no data yet - row is null), how do I detect that the currently clicked row is the second row and make it editable? Can I figure out the rowIndex from MouseEvent and use this to add a new row?

Find code below:

<mx:DataGrid id="myGrid" editable="true" click="clickEvent(event)"
itemEditEnd="endEdit(event)" itemEditBegin="beginEdit(event)" variableRowHeight="true" >

[Code]....

View 2 Replies

Flex :: How To Get ItemDoubleClick Event In Spark DataGrid

Mar 7, 2012

Recently I am working with Spark DataGrid. Before I was using AdvancedDataGrid. In that I was capturing itemDoubleClick event. But I am not able to find such a event in SparkdataGrid. So I want to capture double click event on single row of DataGrid. Some people told that, I have to use my custom ItemRenderer to do that. But is there any way to capture itemDoubleClick event in Spark DataGrid without creating custom ItemRenderer ???

View 1 Replies

Actionscript 3 :: Flex - Selection In Flex Datagrid Does Not Pass The ValueObject To SelectionChangeHandler Function

Aug 11, 2011

I have a TabNavigator, and each tab is a Module. One of the modules is labelled Units and the full code of the module is posted in this post. There are several problems:

1) Forms are not populated with data from the datagrid selection.
2) Selecting a row and clicking delete gives the very-common error: TypeError: Error #1009: Cannot access a property or method of a null object reference.

A trace on the valueObject unit within the selectionChangeHandler function gives NULL. Why? Note: In other modules (other tabs of the TabNavigator), I have DropDownLists populated with units. This means that the valueObject Unit is defined in the other modules. However, valueObjects should be private to modules, and not shared.

[Code]....

View 1 Replies

Flex :: Override Paste Event In DataGrid ItemRenderer?

Mar 16, 2011

I am trying to figure out how to override the default paste logic in a Flex 4 DataGrid ItemRenderer. Does anyone know how to do this?I am trying to capture the event when a user hits Ctrl-V while a cell in the DataGrid has focus and override the logic there.

View 1 Replies

Flex :: Keydown Event For Editable Datagrid Flash?

May 23, 2011

All i have a flex editable datagrid. By default if i press the left navigation arrow key , it moves to the left but not to the next cell. I would like to override the keydown event such that if the left navigation arrow key is pressed down i set the focus to the next cell on the left.

In short the user needs to be able to navigate using the keyboard through the cells using just like in excel(currently the arrow keys move between characters within a cell).

View 1 Replies

Flex :: Which Event Is Fired After The Data Is Loaded Into Datagrid Or Combobox

Feb 26, 2011

Which event is fired after the data is loaded into datagrid or combobox ? (Assuming the dataprovider is set to the datagrid).

View 1 Replies

Flex :: Capture And Optionally Cancel A Row Selection Event In A DataGrid?

Sep 16, 2011

I have a DataGrid, and what I would like to do, is when a user clicks on a row to select it, check a certain condition, and if it's met prevent the row from getting selected and keep the old selection intact.

View 1 Replies

Flex :: DataGrid Editing Cells In Same Row Not Firing Collection Change Event

Mar 20, 2010

I am using the flex datagrid to allow the user to edit some data. My update process relies on a CollectionEvent of type update. Basically I catch this event package the values and update the database. However, if the user edits a cell then moves to edit a cell in the same row the value is updated but a collection event is not fired. Only when clicking out of the row the event is fired. Has anyone had experience with this. I have heard the datagrid is a little quirky is this one of those quirks or am I doing this all wrong?

View 1 Replies

Flex :: Possible To Call Function By Using Datagrid Column?

May 17, 2010

Is it possible to call the function by using the datagrid column item?I want to call the function while the user click the particular column item in the datagrid?

View 1 Replies

Use Right Click / Change Function On A Datagrid In Flex

Jul 4, 2011

i have a datagrid which contained several items,when i click one row, a panel will show,however, if i have already selected one row and then click some blank place, this panel will also show because there is already a selecteditem,which will be a problem. Then i change this click event to change event, however, there will be another problem, which is if i click the same row, nothing will happend. so is there any better idea when i click a row, a panel shows and when i click the blank place, nothing happened.

View 1 Replies

Flex :: RendererAdd Function For Spark DataGrid?

Sep 23, 2011

Like we have rendererAdd function/hook for a Spark List which is dispatched when an itemrenderer is added to the container? Do we have any similar method/hook at DataGrid level also?

View 1 Replies

Flex :: Double Click Event Propagation On Datagrid Dependent On Component Order?

Mar 21, 2010

I'd like to have a double click event on a datagrid in Flex3. The following example only works if the Accordion (id = "mustBeSecond") container comes after the DataGrid. Why is the order of the components important and what can I do to prevent this behavior? (The example does not work. If you change the order of "mustBeSecond" and gridReportConversions" the example works fine)

<mx:Script>
<![CDATA[
import mx.controls.Alert;

[code].....

View 1 Replies

Actionscript 3 :: Using PreventDefault For A View?

Jan 26, 2012

I've created a simple TabbedViewNavigatorApplication. Two of the tabs are going to send text and email, respectively, rather than load a new View. So I need to prevent the default behavior of pushing the new View.

Documentation says a view can cancel a navigation operation by canceling its FlexEvent.REMOVING. However, there apparently is no such Constant for FlexEvent. There is, however, for ViewNavigatorEvent, as described farther down on that first link.

So here's what I've got, but I neither see the trace statements nor am able to stop the navigation:

[Code]...

View 1 Replies

Actionscript 3 :: Sorting Function Not Called In Flex Datagrid?

Oct 11, 2009

I am creating a Datagrid in AS3, and adding a sort function to a column. However, this sort function does never get called. Any ideas?

dg_gruppenUebersicht = new NestedDataGrid;
dg_gruppenUebersicht.sortableColumns = true;
dg_gruppenUebersicht.dataProvider = arrCol_gruppenTnAkt;

[code]....

View 1 Replies

ActionScript 3.0 :: Error 1021: Duplicate Function Definition Function OnComplete1(event:Event):void {

Jan 14, 2010

im having this errors:

1021: Duplicate function definition function onComplete1(event:Event):void {
1021: Duplicate function definition function stopSound1(event:MouseEvent):void {
1021: Duplicate function definition function backSound1(event:MouseEvent):void {

codes i used:

Code:
var thereReq:URLRequest = new URLRequest("SOUNDS/how.mp3");
var there:Sound = new Sound();
var thereControl:SoundChannel = new SoundChannel();

[code]....

View 2 Replies

Flex :: 3 - Flex: Affecting Function Result On Bindable Boolean Not Generating Databinding Event

Mar 14, 2011

I have a small question. I am probably misunderstanding something, but when I do :

[Code]....

View 1 Replies

Actionscript 3 :: Trigger Flex Piechart Item Click Event When A Datagrid Item Is Clicked?

Nov 4, 2011

Is it possible to trigger Flex Piechart Item click event when a Datagrid Item is clicked.If so can anyone give some example.

View 3 Replies

Flex :: Does Dispatching An Event Interrupt A Function

Aug 12, 2009

Let's say function foo() is executing. Suppose that an external event occurs, for which you have a handler. Will function foo() be interrupted so that the event handler can be executed? What is the order of execution in this situation?

View 2 Replies

Flex :: Loader Event Complete Function Only Being Called Once

Feb 21, 2011

So, I'm trying to load resources, add them to a dictionary, and have a drawing method search through that dictionary and draw based on certain predicates. I have a function that iterates through an Vector of Strings, calling on an instance of Loader to load them instantiated as a URLRequest.

private function loadImages(urls:Vector.<String>):void
{
var loader:Loader = new Loader();

[Code].....

So the issue is: Only the first images in my Vector are drawing. Upon further inspection, I found that the completeHandler was only being called once (I put a trace in the complete handler to check). However, the Loader is invoking load everytime the loop iterates. I tried instantiating separate loaders for each resource, just to see if it would work, but I had no luck with that. Do I need to make separate loaders and event handlers? Or am I just not using Loader correctly?

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved