Datagrid Update...

Hi I have an application with multiples datagrid populate
with an XMLList (internal). I've made the datagrid editable for
quick
change and at the end of the page there's an update button. I
was wondering how I could make it work. The update button is
suppose to update all the change in all grid. Not just a
cell. But all cells with one button. On an other topic Tracy said
that you
can update a column with bindable and arrayCollection. But
how to do that with XMLList and all the grids cells not just a
column. The question is maybe stupid but Im new to flex so it's
difficulte to learn it on my own.
thanx.

ok I will try the xml collection. But the data I want to
change is already visible in the datagrid. Like a schedule. I click
a name on the schedule (datagrid),change the name cause it's
editable and after that I push an update button that save all the
change visible and edited in the datagrid. Like a refresh. Cause
right now If I make change in a couple cell. QUi the application
and open it again, it's back to where it was before with the old
data. It's more like a save button for editable
datagrida that I want do. But I was not sure if it's was
possible with the XMLList.

Similar Messages

  • DataGrid update cell event generated twice

    Hi all,
    We are trying to create an editable cell in a datagrid, and in the itemEditEnd method to display an error message if the new value introduced is incorrect. The problem here is that the event is always generated twice.
    Do you know what could cause this?
    Thanks,

    Hi,
    Can you add some additional info.As I checked at my end the things are working fine.
    You can check with the below sample applicaiton:-
    <?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="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
        <fx:Declarations>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import mx.collections.ArrayCollection;
                import mx.controls.Alert;
                import mx.events.DataGridEvent;
                [Bindable]
                private var ac : ArrayCollection = new ArrayCollection([
                    {lbl :"lable1",data:"data1"},
                    {lbl :"lable2",data:"data2"},
                    {lbl :"lable3",data:"data3"}
                protected function datagrid1_itemEditEndHandler(event:DataGridEvent):void
                    trace("Check");
            ]]>
        </fx:Script>
        <mx:DataGrid dataProvider="{ac}" editable="true" itemEditEnd="datagrid1_itemEditEndHandler(event)">
            <mx:columns>
                <mx:DataGridColumn headerText="Lable" dataField="lbl" editable="true" />
                <mx:DataGridColumn headerText="Data" dataField="data" editable="true" />
            </mx:columns>
        </mx:DataGrid>
    </s:Application>
    with Regards,
    Shardul

  • DataGrid - update contents and maintain sort selection

    I have a DataGrid whose 'dataProvider' is bound to an
    ArrayCollection. At some points in time the ArrayCollection is
    replaced with a new set of data provided to the application. This
    causes the DataGrid to be reloaded essentially, which also causes
    the users sort selection to be reset. How can I keep the sort
    selection when replacing the data?

    There may be an easier way to do this, but I set a
    headerRelease handler on the dataGrid and keep track of which
    column is being sorted. When it is time to replace the
    dataProvider, it is possible to sort my dataProvider based on the
    last user click of the header.
    It's not elegant, but it works. With this method I'm able to
    store the user's preferred sort between executions. (that would be
    application executions. Not the user)

  • Inheritance in VO and binding in dataGrid (updated)

    Hi All,
    I'm new to flex and trying to learn a few concepts..
    I'm new using Flex Builder 3 to develop a simple application that displays a Array collection in data grid....
    I have a Value Object called Dept
    package rxr.issuetracker.vo
    import com.adobe.cairngorm.vo.IValueObject;
    [RemoteClass(alias="com.Dept")]
    public class DeptVO implements IValueObject
    public var dept_id:Number;
    public var dept_name:String;
    Another VO is empVO which creates an instance of DeptVO
    package rxr.issuetracker.vo
    import com.adobe.cairngorm.vo.IValueObject;
    [RemoteClass(alias="com.emp")]
    public class empVO implements IValueObject
    public var name:String;
    public var edes:String;
    public var dept_id:Number;
    public var dp:DeptVO;
    I'm trying to implement OOPS in flex...
    I have an ArrayCollection, "arrData" in model class which is bindable...
    package rxr.issuetracker.model
    import com.adobe.cairngorm.model.ModelLocator;
    import mx.collections.ArrayCollection;
    import rxr.issuetracker.vo.*;
    [Bindable]
    public class testModel implements ModelLocator
    private static var modelview:testModel;
    public static function getInstance():testModel
    if(modelview==null)
    modelview=new testModel();
    return modelview;
    public function testModel()
    if(modelview != null)
    throw new Error("only one instance of model can be created");
    public var arrData:ArrayCollection;
    Now i retrieve value from database using spring services as back end..
    I store the value in arrData and using Debug i see that the values are stored as follows:
    model3.arrData
         [0]-rxr.issuetracker.vo.empVO
    dept_id
    edes
    name
    dp
    dept_id
    dept_name
    now i bind this data to dataProvider as follows:
    <mx:DataGrid id="data" dataProvider="{model3.arrData}">
         <mx:columns>
              <mx:DataGridColumn headerText="Column 1" dataField="edes"/>
              <mx:DataGridColumn headerText="Column 2" dataField="name"/>
              <mx:DataGridColumn headerText="Column 3" dataField="dp.dept_id"/>
         </mx:columns>
    </mx:DataGrid>
    here in the output, i get values for edes and name
    but dp.dept_id remains blank...
    how can i bind this inherited data to dataGrid ??
    Message was edited by: sri2520ram

    Hi Sriram,
    Just simply replace the DataGrid column with the below one...No need to do any modifications...further..
    <mx:DataGridColumn headerText="Column 3">
        <mx:itemRenderer>
         <mx:Component>
          <mx:Label text="{data.dp.dept_id}" />
         </mx:Component>
        </mx:itemRenderer>
       </mx:DataGridColumn>
    Actually data is property of the itemrenderer(always available on itemRenderers) which is an object of your dataprovider...
    Probably you dont have good knowledge on itemRenderers..May be you can got through the itemRenderers topic in Flex Docs. You will get an idea..
    You can also check this link instead a very good article from Adobe on itemRenderers..
    http://www.adobe.com/devnet/flex/articles/itemrenderers_pt1.html
    Thanks,
    Bhasker

  • Dynamic DataGrid Issues

    I have a data grid that is updated via streaming data every 5 seconds.  However, when the datagrid updates, all of the user's selections/sorting gets wiped out and the data resets.
    Right now the data is bound to an array directly returned from my service call, so every time it "refreshes" the bound array refreshes triggering the redraw of the grid.
    How can I save the "current state" of the data grid so that when the data updates, all of the sorts/selections/whatever is saved.
    And example of what im looking for is kind of like the windows task manager.  Everything resorts in real time as the data updates, if you have a column sorted.
    Any ideas?

    Thanks for the response.
    That works, but the grid data will not refresh now unless I interact with it.  If I re-sort a column for instance it will give my column new values, but just sitting there it doesnt update. 
    I have seen code where there is a dataprovider.refresh() call, but that is not available on my dataProvider.
    Any suggestions?

  • Send object to mysql database

    hi,
    i wondered how i would go about sending changes i've made in
    datagrid thats stored in an array back to mysql and only
    have the things that were changed in the datagrid updated.
    on(release){
    var myDataArray:Array = root.dgNieuws.dataProvider
    this is where i put the data from the datagrid in the array
    ready to send to php
    but i don't know quite what to do with it then.
    any help would be great
    thx

    NotSerializableException
    This should be pretty obivous, though. You serialize something that's not serializable. Why didn't you just read the API? And thanks to you not printing the stack traces and always catching "Exception", there's no easy way to see where it happens.

  • Explorer 7.0 problem

    Is it possible that there is a problem in Internet Explorer
    7.0 with datagrid updates?
    I tried FireFox and this works fine.
    I feed a datagrid from a MySql database. When the datagrid
    displays it must show the latest entries
    but it does not in Explorer.
    Thanks Michel

    We are experiencing the same problem in our Struts
    application. The Flex portion works fine in Firefox, but in IE 7 it
    is not refreshing the datagrid. It seems to be some type of caching
    issue within IE but we have not been able to resolve this.
    Anyone have any ideas?

  • TableAdapter Configuration Wizard Bind Commands

    I am trying to use the TableAdapter Configuration Wizard to bind Insert and Update strored procedures to a Select stored procedure. When I choose the select stored proc, the list of data columns should appear on the list but nothing happens (it's not searching or anything). The select stored procs takes no other params (exept the Out sys_cursor) and returns 7 columns (string, string, string, datetime, string, int32, int32) nothing fancy. I want to do this to associate Insert and update parameters to specific columns for datagrids updates.
    I am using:
    VS 2010 Pro sp1
    Oracle Developer Tool for vs 11.2.0.2.0
    Oracle client 11.2.0.2.0
    Oracle database 11.2.0.2.0
    ODP version 11.2.0.2.1
    Note: When I drag the stored proc on the dataset gui, I get all the columns.
    Any help would be greatly appreciated.
    Thank you

    Hi Fabs,
    According to your description, this issue is related to MYSQL. I am afraid this is out of our support. I would suggest that you could ask this issue in their official forum. Here is the link,
    http://forums.mysql.com/
    Thanks for your understanding.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Undefined Variable

    I have a beta version of a task management system that uploads new tasks to a SQL database using post and an HTTP service request. The same PHP page being posted to writes back an XML file that I use to get all of the information in a datagrid. All of the forms upload the all of the task info smoothly and the datagrid updates on the fly. My problem arises with a delete button inside the datagrid that that sends the ID of the selected item to my delete tasks PHP page through a function. I keep getting an error 1065 (undefined variable) when I click the delete button nested in a column of the datagrid. The code for my button is as follows
                                <mx:DataGridColumn headerText="clear task" editable="true">
                                    <mx:itemRenderer>
                                        <mx:Component>
                                            <mx:Button label="Delete" click="deleteInfo();" />
                                        </mx:Component>
                                    </mx:itemRenderer>  
                                </mx:DataGridColumn>
    The function in my CDATA reads
    function deleteInfo()
                      var number = dgtasks.selectedItem.number;
                      del_number = number;
                      deleteTask.send();
                      Alert.show(del_number);
    I have tried writing a number of different functions inside deleteInfo () just to see if it would even be called and I still get that error 1065. If anyone could help me out I would really appreciate. Thanks!

    Here is my entire file. The only thing negated are the URL's for the service requests. Thanks again!
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns="*" layout="vertical" creationComplete="send_data();">
    <mx:String id="del_number">-1</mx:String>
    <!--- This is our HTTPService, it will send requests and recieve the latest XML information from the server -->
        <mx:HTTPService id="userRequest" url="myurl" useProxy="false" method="POST" >
        <!--- These are the post variables here, -->
        <!--- <edit_task>{activeId}</edit_task> will send the value of {activeId} to PHP as $_POST['edit_task'] -->
            <mx:request xmlns="">
                <employee>{employee.text}</employee>
                <client>{client.text}</client>
                <title>{title.text}</title>
                <description>{description.text}</description>
                <issued>{issued.text}</issued>
                <due>{due.text}</due>
                <priority>{priority.text}</priority>
                <opened>{opened.text}</opened>
                <adding_value>1</adding_value>
            </mx:request>
        </mx:HTTPService>
        <mx:HTTPService id="updateValue" url="myurl" useProxy="false" method="POST" > 
        <!--- These are the post variables here, --> 
        <!--- <edit_task>{activeId}</edit_task> will send the value of {activeId} to PHP as $_POST['edit_task'] --> 
            <mx:request xmlns=""> 
                <completed>{activeComplete}</completed> 
                <opened>{activeOpened}</opened> 
                <edit_task>{activeId}</edit_task> 
            </mx:request> 
        </mx:HTTPService> 
        <!--This is our HTTPService for removing a task from the table--> 
            <mx:HTTPService id="deleteTask" url="myurl" useProxy="false" method="POST" > 
            <mx:request xmlns=""> 
                <number>{del_number}</number> 
            </mx:request> 
        </mx:HTTPService> 
        <!--- These next 3 lines make String variables that i store the last ID clicked and the 'complete' and 'opened' status of that ID --> 
        <mx:String id="activeId">-1</mx:String> 
        <mx:String id="activeComplete">-1</mx:String> 
        <mx:String id="activeOpened">-1</mx:String> 
                    <mx:Panel width="100%" height="100%" title="Essence Task Manager"> 
                        <mx:DataGrid 
                            id="dgtasks" 
                            dataProvider="{userRequest.lastResult.tasks.task}" width="100%" height="50%" 
                            doubleClickEnabled="true" 
                            itemDoubleClick="alert_descript(event)" 
                            itemClick="clickItem(event);"> 
                            <mx:columns> 
                                <mx:DataGridColumn headerText="Task Number" dataField="number" editable="false"/> 
                                <mx:DataGridColumn headerText="Employee" dataField="employee" editable="false"/> 
                                <mx:DataGridColumn headerText="Client" dataField="client" editable="false"/> 
                                <mx:DataGridColumn headerText="title" dataField="title" editable="false"/> 
                                <mx:DataGridColumn headerText="description" dataField="description" editable="false"/> 
                                <mx:DataGridColumn headerText="issued" dataField="issued" editable="false"/> 
                                <mx:DataGridColumn headerText="due" dataField="due" editable="false"/> 
                                <mx:DataGridColumn headerText="priority" dataField="priority" editable="false"/> 
                                <mx:DataGridColumn headerText="Acknoweledged" dataField="opened" editable="true" rendererIsEditor="true"> 
                                    <mx:itemRenderer> 
                                        <mx:Component> 
                                            <mx:CheckBox selected="{data.opened}" click="data.opened=!data.opened"/> 
                                        </mx:Component> 
                                    </mx:itemRenderer>     
                                </mx:DataGridColumn> 
                                <mx:DataGridColumn headerText="Completed" dataField="completed" editable="true" width="100" rendererIsEditor="true"> 
                                        <mx:itemRenderer> 
                                    <mx:Component> 
                                        <mx:CheckBox selected="{data.completed}" click="data.completed=!data.completed"/> 
                                    </mx:Component> 
                                </mx:itemRenderer> 
                            </mx:DataGridColumn> 
                                <mx:DataGridColumn headerText="clear task" editable="true"> 
                                    <mx:itemRenderer> 
                                        <mx:Component> 
                                            <mx:Button label="Delete" click="deleteInfo();" /> 
                                        </mx:Component> 
                                    </mx:itemRenderer>     
                                </mx:DataGridColumn> 
                            </mx:columns> 
                            </mx:DataGrid> 
                            <mx:Panel title="Add Task" layout="horizontal" width="100%"> 
                                <mx:Form> 
                                    <mx:FormItem label="employee"> 
                                      <mx:TextInput id="employee"/> 
                                    </mx:FormItem>     
                                    <mx:FormItem label="client"> 
                                      <mx:TextInput id="client"/> 
                                    </mx:FormItem>   
                                    <mx:FormItem label="title"> 
                                      <mx:TextInput id="title"/> 
                                    </mx:FormItem> 
                                    <mx:FormItem label="description"> 
                                      <mx:TextInput id="description"/> 
                                    </mx:FormItem> 
                                        <mx:FormItem label="issued"> 
                                      <mx:TextInput id="issued"/> 
                                    </mx:FormItem>   
                                        <mx:FormItem label="due"> 
                                      <mx:TextInput id="due"/> 
                                    </mx:FormItem>   
                                   <mx:FormItem label="priority"> 
                                      <mx:TextInput id="priority"/> 
                                    </mx:FormItem>   
                                    <mx:FormItem label="opened"> 
                                      <mx:TextInput id="opened"/> 
                                    </mx:FormItem>    
                                    <mx:FormItem label="completed"> 
                                      <mx:TextInput id="completed"/> 
                                    </mx:FormItem>   
                                    <mx:FormItem> 
                                  <mx:Button label="Submit" click="send_data()"/> 
                                </mx:FormItem> 
                              </mx:Form> 
                                <mx:TabNavigator width="100%" height="100%"> 
                                <mx:VBox label="description"> 
                                        <mx:Panel title="Task Description" layout="vertical" width="100%" height="100%"> 
                                        <mx:FormItem> 
                                            <mx:Label  text="{dgtasks.selectedItem.description}"/> 
                                        </mx:FormItem> 
                                        </mx:Panel> 
                                    </mx:VBox> 
                                <mx:VBox label="comments"> 
                                <mx:DataGrid width="100%"> 
                                    <mx:columns> 
                                        <mx:DataGridColumn headerText="posted by"/> 
                                        <mx:DataGridColumn headerText="comment"/> 
                                    </mx:columns> 
                                </mx:DataGrid> 
                                </mx:VBox> 
                                </mx:TabNavigator> 
                            </mx:Panel> 
                       </mx:Panel> 
    <mx:Script> 
            <![CDATA[ 
                import mx.events.ListEvent; 
                import flash.events.Event; 
                import mx.controls.Alert; 
                private function send_data() 
                    userRequest.send(); 
                   function alert_descript(event:ListEvent) 
                    var showdescription:String = event.itemRenderer.data.description; 
                    Alert.show(showdescription); 
                function deleteInfo()
                      var number = dgtasks.selectedItem.number; 
                      del_number = number; 
                      deleteTask.send(); 
                      Alert.show(del_number); 
            ]]> 
        </mx:Script> 
        <!--This script is used to import the click event and than passes the variables back out to the mx--> 
        <mx:Script> 
            <![CDATA[ 
                //this is the clickItem function that is called above in the onClick function... 
                function clickItem(event:ListEvent) 
                    var id = event.itemRenderer.data.number; 
                    var comp = event.itemRenderer.data.completed; 
                    var opened = event.itemRenderer.data.opened; 
                    activeId = id; 
                    activeComplete = comp; 
                    activeOpened = opened; 
                    //send_data(); 
                    updateValue.send(); 
            ]]> 
        </mx:Script> 
    </mx:Application>

  • How to update 2 datagrids in 2 different app at the same time?

    I'm very new to flex/flash builder and my question is: first I have to explain how the applications works. The first applications have a form for a customer to fill and datagrid to show the results.The data is send using PHP to a database in the server. The second application have a datagrid for the admin  that show the data that the first application send. Now, when  the data is inserted in the database, the first application dataGrid show the result soon as the records are inserted in the database, but the second application show the records after I refresh the Browser. The second aplication have a delete button to clear records from the database as is obious, the firstt database needs to be refreshed in order to see if the record has been deleted. So what I need is that both applications update as soon as the database is altered.If anyone have a suggestion I appreciate very much thanks in advance.

    Then, the time interval should be implemented in both applications since the first one inserts data and the second one delete the data. Instead of doing time interval I eliminate the second app and make 'states' in the first app for the 'add' and 'delete' data so I was able to open two instances of the app, one using the add state and the other with the delete state thinking that since was the same application both update at the same time but unfortunately I was wrong and one needs the browser refresh anyway. I really not know how to do time interval in flex since is different to flash that you just do the interval for the next frame and back to the first to load the data since is a timeline based app, flex not, besides, I'm just start using flex a couple weeks ago and don't know much about the coding  but I will keep researching to do that. Thanks for the advice and sorry to take so long to answer.

  • Update datagrid

    Hi,
         In my project i had included number of components.In one component i need to update data from a table and have to display in the same page after clicking the update button.I cannot refresh refresh the datagrid. so i just called the datagrid creation complete handler but showing one error like
    "cannot access property or method of null object reference"
    whats the solution??
    Thanks in advance.
    sreejaVirtus

    i had used data services
    i cant send full code...so i m sending the needed part.
    protected  function dataGrid_creationCompleteHandler():void
    getAllFlex_classroomResult.token = flexclassroomService.getAllFlex_classroom();
    protected 
    function btn_update_clickHandler(event:MouseEvent):void{
    var item:Flex_classroom=new Flex_classroom();item.id=dataGrid.selectedItem.id;
    item.classroom=txt_classroom.text;
    if(rb_private.selected==true){
    item.type=
    "Private";}
    if(rb_public.selected==true){
    item.type=
    "Public";}
    updateFlex_classroomResult.token = flexclassroomService.updateFlex_classroom(item);
    if(updateFlex_classroomResult.token){
    Alert.show(
    "Classroom has been updated successfully!");dataGrid.dataProvider=getAllFlex_classroomResult.lastResult;
    while clicking on the button it need to a message and list the updated data in the same page.
    thanks in advance.

  • Datagrid dataprovider not updated after filterfunction/refresh applied.

    I have a datagrid that has about 100 or so rows backed by an arrayCollection - no problems. I use a list of "topics" to filter the view in the datagrid, using a filterfunction assigned to the arrayCollection - no problem. The only editable data in the grid is a single column boolean value represented by a checkbox using an itemrenderer - no problem.
    Problem: I change the state of several checkboxes for my current topic, I select a new topic, then change some check boxes under that topic. When I return to the first topic, the checkboxes are no longer checked - everything is as it was before. I would have thought the arraycollection (dataprovider) was getting updated when I changed the values of the checkboxes, but this does not appear to be the case.
    So, do I need to handle an event to update the dataprovider manually before I change to a new topic, or should it work like I described and I am doing something wrong?
    Thanks.

    Well that would be the problem then. Sometimes this can be done automatically, but most of the time there are some additional considerations you need to take. It sounds like maybe the data state of the render is getting wiped out before the edit is committed.
    I suggest skimming over the following:
    http://livedocs.adobe.com/flex/3/html/celleditor_1.html
    Cheers!

  • DataGrid ComboBox itemRenderer/editor not updating dataProvider properly

    I have a DataGrid with one column using a ComboBox as the itemRenderer. The column is editable but if you trace the dataProvider, the changes lag behind by one. So uncheck two row's ComboBox and the dataProvider only shows one row's data updated.
    Any ideas?

    Yep, its a CheckBox, too early in the morning.
    Another component (DataGrid) will be filtered depending on what rows in the ADG have their CheckBox checked, so leaving the row may be too late.
    Here is the code I have so far. In the itemEditEnd event handler I'm trying to set the field in the dataProvider manually, but it causes an infinite loop. preventDefault and stopImmediatePropagation don't help.
    ----- CheckBoxRenderer.mxml -----
    <?xml version="1.0"?>
    <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.controls.CheckBox;
          [Bindable] public var newSelected:Boolean;
        ]]>
      </mx:Script>
      <mx:CheckBox id="selectedChbx" selected="{data.FLAG}"/>
    </mx:VBox>
    ----- mainapp.mxml -----
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
      <mx:Script>
        <![CDATA[
          import mx.events.AdvancedDataGridEvent;
          import mx.collections.ArrayCollection;
          import mx.controls.CheckBox;
          [Bindable] private var transactions:ArrayCollection = new ArrayCollection([
            {orderID: "33725", theirOrderNumber: "10170", name: "Bob Smith", SKUs: "21", PICKS: "50", FLAG: "true"},
            {orderID: "33729", theirOrderNumber: "10172", name: "Mary Wilson", SKUs: "3", PICKS: "6", FLAG: "true"},
            {orderID: "33730", theirOrderNumber: "10176", name: "Fred Carson", SKUs: "1", PICKS: "2", FLAG: "true"},
            {orderID: "33731", theirOrderNumber: "10177", name: "Morten Hills", SKUs: "5", PICKS: "16", FLAG: "true"},
            {orderID: "33732", theirOrderNumber: "10178", name: "Bill Trundy", SKUs: "5", PICKS: "34", FLAG: "true"},
            {orderID: "33734", theirOrderNumber: "10179", name: "Ocean Boat Supply", SKUs: "8", PICKS: "19", FLAG: "true"},
            {orderID: "33736", theirOrderNumber: "10180", name: "Janet Aberdine", SKUs: "5", PICKS: "18", FLAG: "true"},
            {orderID: "33737", theirOrderNumber: "10181", name: "Kim Restine", SKUs: "2", PICKS: "6", FLAG: "true"},
            {orderID: "33738", theirOrderNumber: "10182", name: "Thomas Overby", SKUs: "5", PICKS: "12", FLAG: "true"}
          public function handleGridChanged(evt:AdvancedDataGridEvent):void{
            var newData:Boolean = CheckBoxRenderer(evt.currentTarget.itemEditorInstance).newSelected;
            trace(evt.rowIndex);
            var obj:Object = transactions.getItemAt(evt.rowIndex);
            trace("BEFORE: " + obj.FLAG);
            obj.FLAG = newData;
            trace("AFTER: " + obj.FLAG);
            transactions.setItemAt(obj, evt.rowIndex);
            return;
            evt.preventDefault();
            evt.stopImmediatePropagation();
    //        for each(var item:Object in transactions){
              //trace(item.FLAG);
        ]]>
      </mx:Script>
      <mx:Label fontSize="12" text="Bulk Print / Pull - Step 1"/>
      <mx:HBox>
        <mx:AdvancedDataGrid id="dgTransactions" dataProvider="{transactions}"
          fontSize="12" editable="true" sortableColumns="true" height="500"
          width="100%" itemEditEnd="handleGridChanged(event);">
            <mx:columns>
              <mx:AdvancedDataGridColumn dataField="orderID" headerText="WMSOID" width="100"
                editable="false" textAlign="center"/>
              <mx:AdvancedDataGridColumn dataField="theirOrderNumber" headerText="Order #"
                textAlign="center" width="130" editable="false"/>
              <mx:AdvancedDataGridColumn dataField="name" headerText="Customer"
                width="125" textAlign="left" editable="false"/>
              <mx:AdvancedDataGridColumn dataField="SKUs" headerText="SKU's"
                width="75" textAlign="right" editable="false"/>
              <mx:AdvancedDataGridColumn dataField="PICKS" headerText="Picks"
                width="75" textAlign="right" editable="false"/>    
              <mx:AdvancedDataGridColumn dataField="FLAG" headerText="I" width="20" textAlign="center"
                editable="true" rendererIsEditor="true" editorDataField="newSelected"
                itemRenderer="CheckBoxRenderer"/>
            </mx:columns>
        </mx:AdvancedDataGrid>
        <mx:DataGrid>
        </mx:DataGrid>
      </mx:HBox>
    </mx:Application>

  • Updating the dataprovider of a datagrid with itemrenderers throws renderers

    Hello all,
    I've run into a problem that I can't seem to figure out.  I have a datagrid that is bound to an arraycollection as the data provider.  A few of my DataGridColumns have itemrenderers.  The renderers work great on the first run, but once the dataprovider is updated, my datagrid renderers fall apart.
    My renderers basically highlight cell items that fall into a particular range. Interestingly, if I have an itemrenderer attached on any dataGridColumn, I get a few repeating/identical rows and itemrenderes that are active in places that they shouldn't be once the dataprovider is updated. Has anyone run into this? How did you solve this? Thanks in advance!!
    Mike

    Another way to create itemRenderer for datagrid is to have a custom components that implements these objects
    mx.controls.listClasses.IDropInListItemRenderer,mx.controls.listClasses.IListItemRenderer, mx.core.IFactory
    For example
    <s:SkinnableContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    implements="mx.controls.listClasses.IDropInListItemRenderer,mx.controls.listClasses.IListItemRenderer, mx.core.IFactory">
    private var _data:Object;
    private var _listData:BaseListData;
    public function newInstance():*
         return new myItemRenderer; // name of your renderer
    public function set data(value:Object):void
         dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
    [Bindable("dataChange")]
    public function get data():Object
    public function set listData(value:BaseListData):void
    public function get listData():BaseListData
    </s:SkinnableContainer>

  • DataGrid Column Sort Prevents Drag From Updating DataProvider

    Hi
    I have a datagrid with an XMLListCollection as the Data Provider.
    I have dragging set on so that when I drag a row to somewhere else in the list the XMLListCollection gets updated just fine and so does the DataGrid.
    However, if a column sort has previously been set this seems to stop the XMLListCollection being updated on the drag.
    I have tried setting the sort property on the XMLListColelction to null and then doing a refresh - this works to a point but it restores the default sort order which is not really what I want as the user may wish to continue from where the column sort got them to.
    I was wondering if anyone had any suggestions please ?
    Thanks a lot.
    Chris

    Hi
    Thanks for replying
    This is what the debugger says:
    TypeError: Error #1010: A term is undefined and has no properties.
        at mx.controls.listClasses::ListBase/makeRowsAndColumnsWithExtraRows()[C:\autobuild\3.2.0\fr ameworks\projects\framework\src\mx\controls\listClasses\ListBase.as:1358]
        at mx.controls.listClasses::ListBase/updateDisplayList()[C:\autobuild\3.2.0\frameworks\proje cts\framework\src\mx\controls\listClasses\ListBase.as:3658]
        at mx.controls.dataGridClasses::DataGridBase/updateDisplayList()[C:\autobuild\3.2.0\framewor ks\projects\framework\src\mx\controls\dataGridClasses\DataGridBase.as:581]
        at mx.controls::DataGrid/updateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\framewor k\src\mx\controls\DataGrid.as:1437]
        at mx.controls.listClasses::ListBase/validateDisplayList()[C:\autobuild\3.2.0\frameworks\pro jects\framework\src\mx\controls\listClasses\ListBase.as:3280]
        at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\3.2.0\frameworks\projects\f ramework\src\mx\managers\LayoutManager.as:622]
        at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.2.0\frameworks\projects \framework\src\mx\managers\LayoutManager.as:695]
        at Function/http://adobe.com/AS3/2006/builtin::apply()
        at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.2.0\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8628]
        at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.2.0\frameworks\projects\framewo rk\src\mx\core\UIComponent.as:8568]
    For instance, after the page with the flash module loads, and I click on a column, I get the error. This is quite random, sometimes I need a couple of tries to get the error...
    If you require more information about it I will try to provide.
    Thank you
    Vlad

Maybe you are looking for

  • How do i set up my hp pc to apple tv?  it won't recognize it

    How do I set up my HP PC through the Apple Tv?  My Ipad is working great, but not the PC.

  • Playing iTunes content through my Sony HDTV via HDMI

    Is it possible to play movies and tv shows purchased from iTunes via miniDVI-DVI-HDMI on my Sony Bravia KDL40W4000? Does the content have to be free of HDCP to be playable? Thank you in advance

  • How to run process flow outside owner project?

    Hi, I have two process flows (process_flow_A and process_flow_B) in two different projects (projectA, projectB). Process_flow_A has to be run after process_flow_B is finished. So what I am thinking now is either put process_flow_A in Project B or put

  • Create plot with time vs array

    Hi I am new in the forum. I have this problem. I would representate 7 plots versus tiime. I calculate time and measure the 7 values in Y-axis and put them in an array. How I can do to plot the array versus time? Thank you in advance Raf

  • Adobe Lightroom can't find my iTunes music

    I'm trying to use the feature in Lightroom to access my iTunes library to add music to a slideshow. I can do this with no problem on my MacPro at work. However, on my iMac at home, my music library is in the Shared folder so that my wife, with her ow