I have problem with the IGridItemEditor.save() method. 

According to the docs for save()...if the data isn't valid, then the data isn't 
saved and the editor is not closed.

So I setup an example to test this, and its seems ok. However, once I enter 
valid data and hit the Tab key, I expect the next column to contain the 
itemEditor. Instead its the column after that (which isnt correct).

Maybe i'm going about this the wrong way, so any advice would be great.
heres a little example demonstrating the problem.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"; 
minWidth="955" minHeight="600">
  <s:VerticalLayout horizontalAlign="center" paddingTop="10"/>

  problem: select first cell ...enter rubbish...then enter valid value...then 
tab => this
  doesnt tab to the next cell instead it tabs to the next one after that.       
  whats going on?

   import mx.collections.ArrayCollection;

   private var myDP:ArrayCollection = new ArrayCollection([
        {col0:"something", col1:4, col2:'goes', col3:'in', col4:'here'},
        {col0:"maybe", col1:3, col2:'this', col3:'one', col4:'as well'},
        {col0:"what", col1:1, col2:'about', col3:'this', col4:'one'},
        {col0:"sean paul", col1:3, col2:'red', col3:'temperature', col4:'um'},
        {col0:"chaka demus", col1:3, col2:'green', col3:'and pliers', 


 <s:Label text="Edit a cell in col0. Enter rubbish, then tab. This will 
highlight error. Then enter 'hello' and tab again....I expect to tab to col1 
not col2"/>

 <s:DataGrid id="dg" editable="true" dataProvider="{myDP}" width="50%">
    <s:GridColumn dataField="col0" headerText="col0">

              override public function save():Boolean 
                if(this.value == "hello")
                  this.textArea.errorString = "";

                  return true;
                  this.textArea.errorString = "Please enter: hello";

                  return false;

    <s:GridColumn dataField="col1" headerText="col1"/>
    <s:GridColumn dataField="col2" headerText="col2"/>
    <s:GridColumn dataField="col3" headerText="col3"/>
    <s:GridColumn dataField="col4" headerText="col4"/>

Reply via email to