DataGrid editing

Does anyone know of a way to track the fields published in one other than its use itemEditEnd Datagrid when the datagrid control is set to editable? Basically I want to persist the lines datagrid edited to a database with php.

Thank you!

These two articles should help you get started:

sql http://blog.paranoidferret.com/index.php/2007/08/02/using-Flex-php-and-JSON-to-Modify-a-My database.
http://blog.paranoidferret.com/index.php/2007/08/24/Flex-PHP-JSON-MySQL-Advanced-updating/

Tags: Flex

Similar Questions

  • Spark DataGrid edit

    Hello

    I find them to be allocated and cannot find a way to make the Spark DataGrid editable for the user input.

    Is it possible at all, or do I have to use MX DataGrid?

    Thank you

    This is my code to the editable DataGrid control:

    
                             
                                  
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                      
                                                 
                                            
                                       
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                      
                                                 
                                            
                                       
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                           
                                                      
                                                 
                                            
                                       
                                       
                                            
                                                 
                                                      
                                                           
                                                                
                                                           
                                                           
                                                           
                                                      
                                                 
                                            
                                            
                                                 
                                                      
                                                           
                                                           
                                                      
                                                 
                                            
                                       
                                  
                             
                        
    
  • itemFocusOutHandler with DataGrid editable selected point question

    Hi all, I'm relatively new to Flex and I have a question that is generating a lot of frustration. I'm sure that the solution is string me in the face, but I just can't see the forest for the trees.

    OK, I am trying to achieve a data grid that is populated with data based on a one-to-many relationship between the people and the courts with a join to show people that do not have assigned courses and then assign these by date if necessary.

    It is action of itemFocusOutHandler where the database is then updated with the selected data grid component.

    Question: when you're away from the cell update the triggering event and the database is updated with the selected new row and not passed. I expect the update to trigger until the selected element is change, but it doesn't seem to be the case.

    Example of

    Course.jpg

    Added to John on the 24th courses

    Tab to Jason the selected item changes, and Jason is added to the database with no entry. ALSOM If then back to John of Jason, the database will be updated with data for John

    View database:

    Table_ID CourseHeader Date Person_IDHeader 4
    1
    28/10/20102

    Where the person is equal to

    Table_ID First Last
    1JohnSmith
    2JasonHolmes

    You are willing to provide any help will be very appreciated.

    Regards, Darren.

    And the code (I tried to simplify this if possible):

    <? XML version = "1.0" encoding = "utf-8"? >

    < s:Application ' xmlns:fx = ' http://ns.Adobe.com/MXML/2009 "

    " xmlns:s = 'library://ns.adobe.com/flex/spark"" "

    "" xmlns:mx = ""minWidth ="955library://ns.adobe.com/flex/mx" minHeight ="600" " "

    " xmlns:register = 'services. Course.*">

    < fx:Script >

                <! [CDATA]

    import mx.controls.DateField;

    import mx.controls.Text;

    import mx.data.ChangeObject;

    import mx.events.CalendarLayoutChangeEvent;

    import mx.events.CollectionEvent;

    import mx.events.DataGridEvent;

    import mx.events.FlexEvent;

    import mx.events.ListEvent;

    protection function dC1_changeHandler(event:CalendarLayoutChangeEvent):Sub

                      {

    var dforQ:String = DateField.dateToString (dC1.selectedDate, "DD/MM/YYYY" );

    var SD189:String = dforQ;

    gateCbyDResult.token = csr.gateCbyD (SD189);

                      }

    protection function dataGrid_itemFocusOutHandler(event:DataGridEvent):Sub

                      {

    var dateSQLDate:String = DateField.dateToString (dC1.selectedDate, "DD/MM/YYYY" );

    var entrydate:String = dateSQLDate;

    saveNewResult.token = csr.saveNew(dataGrid.selectedItem.course,entrydate,dataGrid.selectedItem.empid);

                      }

                ]] >

    < / fx:Script >

    < fx:Declarations >

    "" < csr:Csr id = "CSR" fault ="Alert.show (event.fault.faultString +"\n"+ event.fault.faultDetail)" showBusyCursor = "true""/ > "

    " < s:CallResponder id ="saveNewResult"""/ >

    " < s:CallResponder id ="gateCbyDResult"""/ >

    < / fx:Declarations >

                < mx:DataGrid x=" 103 " y=" 252 "

                            id="dataGrid"

    {" dataProvider ="{}gateCbyDResult.lastResult}"" "

    " verticalScrollPolicy ="off"" "

    {" number of lines ="{}dataGrid.dataProvider.length}"" "

                            editable="true"

    itemEditEnd = "dataGrid_itemFocusOutHandler (event)" " >

                           

    < mx:columns >

    "" < mx:DataGridColumn headerText = "last" dataField ="lastName" editable = "false""/ > "

    "" < mx:DataGridColumn headerText = "first" dataField ="firstName" editable = "false""/ > "

    "" < mx:DataGridColumn id = "courseInput" headerText ="course" dataField = "course" editable ="true""/ >

    < / mx:columns >

    < / mx:DataGrid >

    "" < mx:DateChooser id = "dC1"change = "dC1_changeHandler (event)" x = "102" y ="38'' / >

    < / s:Application >

    Thank you again...

    If your topic says Manager itemFocusOut, implies that you are using a

    event Focusout/focusouthandler().  I did not read the code that carefully.

    Verify that the selectedItem has already changed.  Maybe he has.  You

    must be able to use the information in the DataGridEvent to access to the

    data item that was published.

  • TextArea and DateField in DataGrid editable after that 'editable' set to 'false '.

    I have a DataGrid, and although I have set the 'editable' DataGrid 'false' field and also put the field 'editable' 'false', the DateFields and the text box columns are always editable. Someone knows why?

    <mx:DataGrid id="touchpointDG" dataProvider="{contactTouchpointsXLC}" width="100%"
    alternatingItemColors="[0x80BDE0, 0xD2F5E9]" rowHeight="25" editable="false">
    <mx:columns>
      <mx:DataGridColumn dataField="touchpointDate" headerText="Date" 
        itemRenderer="components.DateFieldXML" width="100" editable="false"/>
      <mx:DataGridColumn dataField="touchpointType" headerText="Type" width="170"/>
      <mx:DataGridColumn dataField="touchpointResult" headerText="Result" width="120"/>
      <mx:DataGridColumn dataField="touchpointNextAction" headerText="Next Action" width="205"/>
      <mx:DataGridColumn dataField="touchpointNextActionDate" headerText="Next Date" 
        itemRenderer="components.DateFieldXML" width="100" editable="false"/>
      <mx:DataGridColumn dataField="touchpointDetails" editable="false" 
        headerText="Touchpoint Details" itemRenderer="mx.controls.TextArea"/>
    </mx:columns>
    </mx:DataGrid>
    
    

    It only determines if the DG opens an editing session.  It is not actually set editable = false on the component.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • DataGrid editable problems LabelFunction

    Hello

    I have problems with a datagrid with editable columns and labelFunctions.

    The problem is that when I leave the field editable by a path that wasn't with the escape key, the datagrid again apply the labelFunction and destroy the formattion number adding a lot of numbers.

    When the field is full of 0000,00 it only adds zeros, like 0.000.000,0000 and continue after doing the same process.

    When the field contains a nonzero number, he applies the labelFunction and after he removed the labelFunction. After several times it just make the issue disappear and the cell is empty.

    I have read the documentation on the modification of cells and tried to implement a solution to prevent the cell to be edited, without success.

    The source code is attached for some advice on my problem.

    Thanks, Fredy.

    You may need to call destroyItemEditor when you call preventDefault()

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • DataGrid editable programmaticaly built XmlListCollection need help

    Hi, I am trying to build an editable datagrid with 20 empty lines in it. Users will fill the cells, then gets stored in a database, and then later by making selections in a combobox control, they can bring back these data for viewing and modification. I tried to create the XML dynamically, and then on the XmlListCollection addItem does not. Can someone please indicate where I'm wrong? Thank you!

    [Bindable] private var teamGridDataAsXml:XML;
    [Bindable] private var teamGridData:XMLListCollection;

    private function initEmptyTeamGrid (): void {}

    teamGridData = new XMLListCollection();
    var s:String = '< lines > ';
    for (var i: int = 0; i < 20; i ++) {}
    s += ' < row rowIndex =------"" "+ i +" \ "agentId =" firstName = "lastName =" country = "/ >";
    }
    s += ' < / ranks > ';

    teamGridDataAsXml = new XML (s);
    teamGridData.addItem (teamGridDataAsXml);

    }

    < mx:DataGrid id = "agentInfo" editable = "true" dataProvider = "{teamGridData}" width = "100%" height = "100%" number of rows = "20" >
    < mx:columns >
    "< mx:DataGridColumn headerText =" # "dataField="@rowIndex "editable ="false"/ >
    "< mx:DataGridColumn headerText ="Agent ID"dataField="@agentId "editable ="true"/ >
    "< mx:DataGridColumn headerText ="First name"dataField="@firstName "editable ="true"/ >
    "< mx:DataGridColumn headerText ="Last Name"dataField="@lastName "editable ="true"/ >
    "< mx:DataGridColumn headerText ="Country"dataField="@country "editable ="true"/ >
    < / mx:columns >
    < / mx:DataGrid >

    teamGridDataAsXml = new XML (s);
    trace (teamGridDataAsXml.ToXmlString ()); to be sure, you have good xml
    var xlRows:XMLList = teamGridDataAsXml.row;
    trace (xlRows.length ()); What do you expect?
    teamGridData = new XMLListCOllection (xlRows);

    You can pass the variable xml and go straignt to the XMLListCollection also. In the loop, build the XML node, using the literal XML syntax and then call addItem * inside the loop *.
    Tracy

  • Impossible for make checkbox in datagrid editable

    It is a sample of the documentation for flex. I added editable = "false" for the StairMaster and the checkbox columns. The box always changes if you click on it! I want to only display this column. Any ideas?

    <? XML version = "1.0"? >
    <!--itemRenderers\inline\CBInlineCellEditor.mxml-->
    "< mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml" > "
    < mx:Script >
    <! [CDATA]



    Import mx.collections.ArrayCollection;

    [Bindable]
    private var myDP:ArrayCollection = new ArrayCollection([)
    {label1: "Order #2314", contact: 'John Doe'}
    {as: 3, solddate: new Date (2005, 0, 1), sent: true},
    {label1: "Order #2315", contact: 'Jane Doe'}
    {as: 3, solddate: new Date (2005, 0, 5), sent: false}
    ]);
    private void checkCheck(e:Event):void {}
    trace ("edited");

    }

    []] >
    < / mx:Script >

    < mx:DataGrid id = "myDG".
    dataProvider = "{merge}.
    variableRowHeight = "true" itemEditEnd = "checkCheck (event)" "
    width = "500" height = "250".
    Editable = "true" >
    < mx:columns >
    < mx:DataGridColumn dataField = "label1".
    headerText = "Order #".
    Editable = "false" / >
    < mx:DataGridColumn dataField = "as".
    headerText = "quantity".
    Editable = "false".
    itemEditor = "mx.controls.NumericStepper"
    editorDataField = "value" / >
    < mx:DataGridColumn dataField = "solddate."
    headerText = "Date".
    itemRenderer = "mx.controls.DateField"
    rendererIsEditor = "true".
    editorDataField = "selectedDate" / >
    < mx:DataGridColumn dataField = "sent".
    itemRenderer = "mx.controls.CheckBox"
    rendererIsEditor = "true".
    Editable = "false".
    editorDataField = "selected" / >
    < / mx:columns >
    < / mx:DataGrid >
    < / mx:Application >

    Hello
    I think box click event works always able to say editable = false. Then create as a component separate ItemRender and add this ActionScript, it could stop your checkbox toggle.


    http://www.Adobe.com/2006/mxml"click =" toggle () ">"

    private void toggle (): void {}
    If (this.) Selected is true)
    This.Selected = false;
    on the other
    This.Selected = true;
    }
    ]]>

  • Update datagrid after text user input?

    Hi guys

    I have a datagrid editable.

    When you enter text in there, I noticed that the dataprovider only is not updated until after having clicked on the line twice.

    for example

    Type "what's new" in the "Whoopa" column, press return (or click on another line), then, in function cell_edit_Ended(event:DataGridEvent)...

    var _newText = .text TextInput (event.currentTarget.itemEditorInstance);

    trace (_newText;) tracks "what's new".

    trace ("file:" + data_grid.dataProvider.getItemAt (_row) ["Artist"]); traces of nothing

    Click on another line and trace ("file:" + data_grid.dataProvider.getItemAt (_row) ["Artist"]); tracks "what's new".

    How to update?  It is originally goofy errors with deletion of the duplicate function, with that I followed.

    Cheers for your help.

    Just open a new AS3 doc (FP11 +) and make a string with the data that your JSON.stringify (done) and test a JSON.parse (top) directly in a table:

    var str:String = ' [{'Delete': 'X', 'Gender': 'None', 'Duo' ': ' '}]';

    var obj:Array = JSON.parse (str);

    trace (obj);

    You get the error:

    Scene 1, Layer 'layer 1', frame 1, line 2. 1118: constraint implied value of static type Object to a type perhaps unrelated table.

    Because JSON.parse () returns an "object" and you are assigning it to a "table".

    Even if you typed _myData tabular form and your JSON is technically a JSON array notation, the JSON.parse () function supports not return them in table form, therefore the above error.

    Fortunately the JSON.parse () returns the object in notation, you can use it as a table. Consider the modified here source:

    var str:String = ' [{'Delete': 'X', 'Gender': 'None', 'Duo' ': ' '}]';

    var obj:Object = JSON.parse (str);

    trace (obj[0]. Delete + ', ' + obj[0]. Kind + ', ' + obj[0]. Duo);

    Track:

    X, no,.

    Bottom line, no need to make the table (he is not still valid), just assign the dataProvider at the same time you analyze.

    data_grid. DataProvider = new DataProvider (JSON.parse (event.target.data));

  • Keep edition of the course of the session

    I want to keep Spark datagrid edition goes sesion when a user presses the ESC key. I tried:

    protected function textArea_keyDownHandler(event:KeyboardEvent):void

    {

    If (event.keyCode is Keyboard.ESCAPE)

    {

    event.stopPropagation ();

    Event.stopImmediatePropagation;

    }

    }

    < s:TextArea id = "textArea" fontSize = "11" fontFamily = "Courier New" width = '100% ' keyDown = "textArea_keyDownHandler (event)" / >

    Does not help. Any idea?

    Thank you

    I think that you need a custom editor that returns false on the save() method

  • Style of text in a datagrid?

    I added styles to my text from datagrid using setStyle and and setRenderStyle. My datagrid fields are defined as editable. When you click the editable text, it is a much smaller font. Is it possible to add styles to the police of entry?

    Hello

    You can write a custom converter that extends TextInput for any DataGridColumn. Here is the code snippet from the example I tried. Data setting is not correct. You can write clean code by following this path.

    Please let me know if you need more information about the use of custom components.

    Kind regards

    Karthikeyan Ramasamy

    # DataGrid.fla #.

    Import fl.controls.DataGrid;
    Import fl.events.DataGridEvent;
    Import fl.controls.dataGridClasses.DataGridCellEditor;
    Import fl.controls.dataGridClasses.DataGridColumn;
    Import fl.controls.TextInput;

    var item1:Object = {Date: "June 26, 2009", time: "17:30", task: "Meet Kayla to downtown for dinner"};
    var item2:Object = {Date: "June 27, 2009", time: '08:30 ', task: 'Download a tutorial'};
    var item3:Object = {Date: "28 June 2009", time: "14:00", task: "Blow up a bridge!"};

    var myTextFormat:TextFormat = new TextFormat();
    myTextFormat.font = 'Comic without MS';
    myTextFormat.color = 0 x 666666;
    myTextFormat.size = 14;
    myTextFormat.bold = true;

    var datagrid:DataGrid = new DataGrid;
    DataGrid.Move (20, 50);
    DataGrid.Width = 480;
    DataGrid.Height = 130;
    datagrid.rowHeight = 35;
    DataGrid.editable = true;
    DataGrid.Columns = ['Date', 'Time', 'Task'];

    var dgc1:DataGridColumn = new DataGridColumn ("Date");
    dgc1.itemEditor = new MyCustomItemRenderer();
    datagrid.addColumn (dgc1);

    var dgc2:DataGridColumn = new DataGridColumn ("Time");
    dgc2.itemEditor = new MyCustomItemRenderer();
    datagrid.addColumn (dgc2);

    var dgc3:DataGridColumn = new DataGridColumn ("Task");
    DGC3.itemEditor = new MyCustomItemRenderer();
    datagrid.addColumn (dgc3);

    DataGrid.Columns [0]. Width = 120;
    DataGrid.Columns [1]. Width = 70;
    datagrid.resizableColumns = true;
    datagrid.setRendererStyle ("textFormat", myTextFormat);
    datagrid.addItem (item1);
    datagrid.addItem (item2);
    datagrid.addItem (item3);

    addChild (datagrid);

    # MyCustomItemRenderer.as #.

    package
    {
    import flash.text.TextFormat;
    Import fl.controls.listClasses.ICellRenderer;
    Import fl.controls.listClasses.ListData;
    Import fl.controls.TextInput;
       
    SerializableAttribute public class MyCustomItemRenderer extends TextInput implements ICellRenderer
    {
    private var _listData:ListData;
    private var _data:Object;
    private var _selected:Boolean;
    private var tf:TextFormat;
           
    public void MyCustomItemRenderer (): void
    {
    TF = new TextFormat();
    TF. Bold = true;
    TF. Size = 15;
    this.setStyle ("textFormat", tf);
    }
    public function set {data(d:Object):void}
    _data = d;
    }
    public function get data (): object {}
    return _data;
    }
    public function set {listData(ld:ListData):void}
    _listData = ld;
    }
    public function get listData (): ListData {
    Return _listData;
    }
    public function set {selected(s:Boolean):void}
    _selected = s;
    }
    public function get selected (): Boolean {}
    return _selected;
    }
    public function set {selectedItem(s:Boolean):void}
    s = _data;
    }
    public function get selectedItem (): Boolean {}
    return _data;
    }
    public void setMouseState(state:String):void {}
       
    }
    }
    }

  • DataGrid, error using DateField as the post editor

    Hello

    I am trying to create a DataGrid editable using Flex 2.0.1. One of the columns is of type Date, so I want to use a DateField as the item editor.

    The problem is that I get an error when the focus is removed from the DateField:

    TypeError: Error #1034: Assegnazione di tipo forzata limpeza no:
    Impossibile convertire "10/01/1980" in Date.
    at mx.controls::DataGrid/::itemEditorItemEditEndHandler()

    It seems that the DataGrid control is trying to assign the value of raw string in my data provider object.

    It is a code snippet that reproduce the problem:

    < mx:Script >
    <! [CDATA]
    [Bindable]
    private var lines: collection ArrayCollection = new ArrayCollection();
    private function init (): void {}
    called on creationComplete
    var testRow:PersonVO = new PersonVO();
    testRow.name = "name";
    testRow.surname = "name";
    testRow.birthDate = new Date (1980, 9, 1);
    rows.addItem (testRow);
    }
    []] >
    < / mx:Script >
    < mx:DataGrid dataProvider = "{lines}" editable = "true" >
    < mx:columns >
    < mx:DataGridColumn dataField = "name" / >
    < mx:DataGridColumn dataField = "name" / >
    < mx:DataGridColumn dataField = "birthDate" >
    < mx:itemEditor >
    < mx:Component >
    < mx:DateField formatString = "DD/MM/YYYY" / >
    < / mx:Component >
    < / mx:itemEditor >
    < / mx:DataGridColumn >
    < / mx:columns >
    < / mx:DataGrid >

    Do you have an idea of the cause of this behavior?

    Thank you
    Cosma

    Hello

    I managed to do works by adding the editorDataField = "selectedDate" attribute to the element of DataGridColumn, even leaving the attribute date of birth on the VO as public Date variable.

    Thanks anyway for the help.
    Cosma

  • Flex error 1034: has no Type constraint

    I spread the File as AudioFile class.  Only, I added a new property 'category.  I intend to filter the files to a directory structure and to keep the AudioFile objects in a simple indexed array.  I also want to add category information to the AudioFile property object 'category.  The error is thrown after that I called getDirectoryListing, assign the file objects returned to "content: table ', and then I iterate over 'content' assinging each object AudioFile file object.  I thought that the AudioFile is a file extension that is not a problem.  The heart of the issue is how getDirectoryListing returns objects file but I need AudioFile objects.  My next instinct is to override the getDirectoryListing method, but I can't find the class declaration for the file.

    Is it possible to throw objects as objects AudioFile file?  Should I use a different strategy for the assignment of the category for the objects in file info?  Maybe I shouldn't be the extension of class leader at all.  I'm a bit stuck.  Any help would be greatly appreciated.

    Here is my code.  Please note that this is my first flex/air/actionscript I've ever written.  I use Flash Builder 4.5 and my goal is to Office Air.  The AudioFile extended class is AudioFile.as.

    package
    {
    import flash.filesystem.File;

    public class AudioFile extends file
    {
    public void AudioFile()
    {
    }

    public var category: String;
    }
    }

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:WindowedApplication ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/mx".
    xmlns:samples = "samples.*".
    applicationComplete = "init ()" width = "386" height = "581" "
    Initialize = "initData ()" >
    < s:layout >
    < s:VerticalLayout paddingTop = paddingLeft "6" = "6" paddingRight = paddingBottom "6" = "6" / >
    < / s:layout >

    < fx:Script >
    <! [CDATA]
    import AudioFile;

    import flash.events.Event;
    import flash.filesystem.File;

    Import mx.collections.ArrayCollection;
    Import mx.controls.Alert;

    private var audioObj:AudioFile = new AudioFile();

    protected function init (): void
    {
    Main window of app AIR Center on the screen
    nativeWindow.x = (Capabilities.screenResolutionX - nativeWindow.width) / 2;
    nativeWindow.y = (Capabilities.screenResolutionY - nativeWindow.height) / 2;
    Receive messages when minimize/maximize occurs
    addEventListener (NativeWindowDisplayStateEvent.DISPLAY_STATE_CHANGING, onDisplayStateChange);
    }
    Handles when the application is reduced to the minimum and maximum
    protected function onDisplayStateChange(e:NativeWindowDisplayStateEvent):void
    {
    trace ("display status changed from" + e.beforeDisplayState + "" + e.afterDisplayState);
    }

    private var masterList:ArrayCollection = new ArrayCollection();
    private var dgArray:Array = new Array();

    [Bindable]
    private var initDG:ArrayCollection;

    public function initData (): void {}
    var initDG:ArrayCollection = new ArrayCollection (dgArray);
    }

    private void parse (): void {}
    ActionScript file

    var sourceDir:AudioFile = getSourceDir();
    var fileList:Array = new Array();
    var dirList:Array = new Array();

    function transverseDirStructure(sourceDir:AudioFile):Array {}
    var flag: Boolean = false;
    var dirList:Array = new Array();
    var fileList:Array = new Array();

    {}
    var content: Array = sourceDir.getDirectoryListing ();

    for (var i: int = 0; i < contents.length; i ++) {}
    test for isDirectory
    var file:AudioFile = content [i];
    If (file.isDirectory == true) {}
    dirList.push (file);
    }
    else {}
    fileList.push (file);
    }
    }

    If (dirList.length == 0)
    flag = false;
    else {}
    recursion
    fileList = fileList.concat (transverseDirStructure (dirList, fileList));
    }
    } While (flag == false)

    Return to the file list;
    }

    function filterExtensions(fileList:Array):Array {}
    var cleanExtensionsList:Array = new Array();
    for each {(var i: AudioFile in the list of files)
    If (i.extension == ".wav" |) ".aiff") {}
    cleanExtensionsList.push (i);
    }
    }

    Return cleanExtensionsList;
    }

    function filterSize(fileList:Array):Array {}
    var cleanSizeList:Array = new Array();
    var maxFileSize:int = 350000;
    for each {(var i: AudioFile in the list of files)
    If (i.size < maxFileSize) {}
    cleanSizeList.push (i);
    }
    }

    Return cleanSizeList;
    }

    function categorizeAudioFiles(fileList:Array):Array {}
    var masterList:Array = new Array();

    var flag: Boolean = true;

    var category: Array = new Array();
    Categories.push ("Kick", "Snare", "Hat", "crash", "clap");

    for each {(var i: AudioFile in the list of files)
    for each {(var x: String sous catégories)}
    If (i.name.search (x) > 0) {}
    Add category name to the extended property.
    i.Category = x;
    masterList.push (i);
    }
    }
    }

    return masterList;
    }

    fileList = transverseDirStructure (fileList);
    fileList = filterSize (fileList);
    fileList = filterExtensions (fileList);
    fileList = categorizeAudioFiles (fileList);
    }

    private function generateRandom (): void {}

    }

    private function setDestination (): void {}
    var file:AudioFile = new AudioFile();
    file.addEventListener (Event.SELECT, dirSelected);
    file.browseForDirectory ("select a directory");
    function dirSelected(e:Event):void {}
    txtDestination.text = file.nativePath;
    }
    }

    private void getDestination (): {AudioFile
    var destinationDir:AudioFile = new AudioFile();
    txtDestination.text = destinationDir.nativePath;

    Return destinationDir;
    }

    private void getSourceDir (): {AudioFile
    var sourceDir:AudioFile = new AudioFile();
    sourceDir.nativePath = txtBrowse1.text;

    return sourceDir;
    }

    private function setSourceDir (): void {}
    var file:AudioFile = new AudioFile();
    file.addEventListener (Event.SELECT, dirSelected);
    file.browseForDirectory ("select a directory");
    function dirSelected(e:Event):void {}
    txtBrowse1.text = file.nativePath;
    }
    }

    Control logic

    []] >
    < / fx:Script >

    < mx:Form width = "373" height = "113" id = "formChooseDirectory1" >
    < mx:FormHeading label = "1. Width to choose a Source directory... "="315"fontSize ="13"fontFamily ="Verdana"color ="#CF71FF"/ >
    < s:Button Label = fontFamily 'Browse... '. "="Verdana"fontSize ="13"color ="#CF71FF"id ="btnBrowse1"enabled ="true"click ="setSourceDir ()"/ >
    < s:TextInput width = "333" id = "txtBrowse1" active = "false" text = "C:\Users\RokaMic\Bangin Beats" / >
    < / mx:Form >
    < mx:Form width = "373" height = "231" id = "formAnalyze" >
    < mx:FormHeading label = "2. FontFamily to analyze samples... "="Verdana"fontSize ="13"color =" #00D8FF "width ="245"/ >
    < s:Button label = "Analyze" fontFamily = "Verdana" color = "#00D8FF" id = "btnAnalyze" enabled = "true" click = "analyze ()" / >
    < mx:DataGrid editable = "false" enabled = "true" fontFamily = "Verdana" color = "#00D8FF" width = "337" dataProvider = "{initDG}" >
    < mx:columns >
    < mx:DataGridColumn headerText = "File name" dataField = "filename" color = "#00D8FF" fontFamily = "Verdana" / >
    < mx:DataGridColumn headerText = "Category" dataField = "category" color = "#00D8FF" fontFamily = "Verdana" / >
    < / mx:columns >
    < / mx:DataGrid >
    < / mx:Form >
    < mx:Form width = "374" height = "173" id = "formGenerate" >
    < s:Button label = "Generate Drum Kits" width = "342" height = "52" fontSize = "18" = "Verdana" color = fontFamily "#00FF06" id = "btnGenerate1" enabled = "true" click = "generateRandom ()" / >
    < mx:FormItem label fontFamily = "How much?" = "Verdana" fontSize = "13" color = "#00FF00" width = "340" >
    < s:HSlider width = stepSize '206' = value '1' = "1" minimum = "1" maximum = "25" id = "sliderHowMany" liveDragging = "true" / >
    < / mx:FormItem >
    < s:Button label = 'Destination '.... "color =" #00FF00 "id ="btnDestination"enabled ="true"click ="setDestination ()"/ >
    < s:TextInput width = "332" id = "txtDestination" enabled = "false" / >
    < / mx:Form >
    < / s:WindowedApplication >

    browsing a directory structure looks like you're going to go through everything in the directory.  If you encounter another directory (void), I thought you were going to go through everything in that directory (void) etc.  Thus, you might end up not being able to use a properly return statement.  I think that's not the problem, so you don't need to deal with this issue.

  • Need of TitleWindow close button to just do its thing

    Hello everyone

    I have a datagrid editable in a TitleWindow with a close button active.


    If I hit the close button of a function, it does not allow me to change the DataGrid (and performs its function). How can I have the close button just do his thing (but which allows me to change my gata grid in the window? It acts as if I try to change the datagrid control. Its drivig me a little crazy. So I'll take a few asprins and hope some wise soul to help me

    This is the code example:

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:mx mx:Application ' http://www.Adobe.com/2006/MXML "layout ="absolute"> "
    < mx:Script >
    <! [CDATA]

    Import mx.collections.ArrayCollection;
    Import mx.events.DataGridEvent;

    [Bindable]
    private var jan: Number = 200;
    private var feb:Number = 123;
    private var mar: Number = 67;
    private var apr:Number = 108;
    private var may: Number = 126;
    private var jun:Number = 199;
    private var jul:Number = 199;
    private var aug:Number = 199;
    private var MS: Number = 199;
    private var oct:Number = 199;
    private var nov:Number = 199;
    private var dec:Number = 199;
    private var dataset:ArrayCollection = new ArrayCollection ([] collection
    {Month: "January", data: jan},.
    {Month: "February", data: feb},.
    {Month: "March", data: mar}.
    {Month: "April", data: Apr},.
    {Month: "May", data: can},.
    {Month: "June", data: jun},.
    {Month: "July", data: jul},.
    {Month: "Auguste", data: aug},.
    {Month: "September", data: MS},.
    {Month: "October", data: oct}.
    {Month: "November", data: nov},.
    ([{Month: "December", data: dec}]) ;
    []] >
    < / mx:Script >

    < mx:ViewStack id = "viewstack1" width = "464.46967" height = "408.18182" = red "-12" horizontalCenter = "0" >
    < mx:Canvas id = "Data" width = "100%" height = "100%" >
    < mx:TitleWindow id = "DataUn" width = "450" height = "350" layout = "absolute" title = "Data" horizontalCenter = "0" showCloseButton "-10" = red = "true" >
    < mx:DataGrid = "11" x = "10" width = "405.98486" height = "290" dataProvider = "{dataset}" editable = "true" >
    < mx:columns >
    < mx:DataGridColumn width = "200" headerText = "Month" dataField = "Month" editable = "false" sortable = "false" / >
    < mx:DataGridColumn headerText = "Data" dataField = "Data" editable = "true" sortable = "false" / >
    < / mx:columns >
    < / mx:DataGrid >
    < / mx:TitleWindow >
    < mx:Button x = '7' y = "386" label = "Graph" click = "viewstack1.selectedChild = Graph; "/ >
    < / mx:Canvas >
    < mx:Canvas id = "Graph" width = "100%" height = "100%" >
    < mx:TitleWindow id = "Graphed" width = "450" height = "350" 'absolute' page = set title = "Graph" horizontalCenter = "0" showCloseButton = red '-10 "="true"click =" viewstack1.selectedChild = Data; ' >
    < mx:ColumnChart = "8" x = "8" id = "columnchart1" width = "412.12122" height = "290" dataProvider = "{dataset}" >

    < mx:horizontalAxis >
    < mx:CategoryAxis categoryField = "Month" / >
    < / mx:horizontalAxis >
    < mx:series >
    < mx:ColumnSeries displayName = 'Series 1' xField = "Month" yField = "Data" / >
    < / mx:series >
    < / mx:ColumnChart >
    < / mx:TitleWindow >
    < / mx:Canvas >
    < / mx:ViewStack >
    < / mx:Application >

    It is still not very clear what you want to do here.  Hear you want to be able to click on the close button (X) when you change a field in the DataGrid, but the field remains in edit mode?  I ran your example (less of trace components, I don't have at home, snowy out of the Flex Pro and work at the moment) and it seems to behave as "I think", but maybe I don't understand what your goal is.

    Also - if you use the close (X) button for what anyone other that close a dialog box... I would not recommend doing so in a user interface design perspective.  Users will expect a "Close" button to behave as it does in other applications, to close the Panel/dialog/window (not the change of the display in a dialog box).  If you intend to use it to get out a secondary view I reconsidérerais.  You can try a TabNavigator (lazy human ViewStack but very effective if it fits your application) instead of a ViewStack.

  • Last edited DataGrid field does not show value

    I use an editable datagrid when the user types in their data. When they click on it does not show the last value they came outside the grid of data. The value is there, and if you click on this field once again it will appear. If you click outside the field for the second time, this time, the value remains displayed. How can I get the value is displayed the first time the datagrid control loses focus?

    I tried

    dataInput.addEventListener (FocusEvent.FOCUS_OUT, updateCell);

    function updateCell(e:FocusEvent):void {}
    dataInput.drawNow ();
    }

    This is not the default behavior.  you do something to cause this problem.

    If you don't see everything you do that could cause this problem, create a new fla with a datagrid control, fill and make it editable.  There should be no code at the level of the grid of data other than the assignment of content.  do you see a problem?

  • ItemEditor valueCommit when editing in a datagrid control spark

    I'm trying to get round head such things when editing in a DataGrid ItemEditor spark but having problems

    I tried to put a flag in the data provider, if something has changed. but validating the value isn't going to get fired when the user changes a value:

    "< GridColumn width ="140"headerText ="Margin (off)"headerText.editMode =" Margin (montage) "dataField ="margin"editable ="false"editable.editMode =" true ">
    < itemEditor >
    < fx:Component >
    < DefaultGridItemEditor >
    < valueCommit >
    <! [CDATA]
    this.data.isModifiedClientSide = 1;
    []] >
    < / valueCommit >
    < / DefaultGridItemEditor >
    < / fx:Component >
    < / itemEditor >

    < / GridColumn >

    What do you think?

    valueCommit isn't a bubbling event, so you probably need to listen to the specific element within the itemEditor that captures text entry.

Maybe you are looking for

  • Ready NAS NV + - different disc size

    Hello I have a ReadyNAS NV + and failed drive and have to by a new one.Is it possible to increase the size on a single disc.Today, its 4 * 1 TB disks and I want to change a 2 TB drive (for the future to replace the other 3 for the greater)The RAID wi

  • HomeScreen.setName wasn't perfect?

    I use HomeScreen.setName to change the title of my application on the home screen, it was working correctly, however, after that reboot device the title on the home screen has been reset to default, including wroten in BlackBerry_App_descriptor.xml.

  • Notify at a specific time every day

    Hi, I want to add a notification on the hub every day at a time, as if, as a reminder. Is there a way to do it without using apps headless... ??

  • Split the screen vertically

    Hello I have a question to split the screen of a BlackBerry. I use BlackBerry JDE 4.5. I want to split my screen into two vertical parts. Then I want to have each side a RichTextField (later with different font size). In addition, I use a colorful pa

  • I'm trying to fax using Lexmark 2400. Only fax does not work.

    I'm trying to fax using Lexmark 2400. It of the only thing that does not work on lex 2400 and windows 7 Original title: program compatibility Application Applications App Apps game games Legacy Crash crashes Hang hangs