RE: GridColumn and dataProvider update

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

RE: GridColumn and dataProvider update

Brian Raymes
Hello,

You should be able to add a "collectionChange" event handler to your ArrayCollection.

https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/collections/ListCollectionView.html#event:collectionChange

For example:

--------------------------------------------------------------------------------------------------------------

<s:ArrayCollection collectionChange="collectionChangeHandler (event)">

--------------------------------------------------------------------------------------------------------------

private function collectionChangeHandler(event:CollectionEvent):void
{
        // See changes here. There will be a "kind" property in the event object to tell you which kind of change has occurred.
}

--------------------------------------------------------------------------------------------------------------

Brian

-----Original Message-----
From: pol2095 <[hidden email]>
Sent: Sunday, May 10, 2020 11:08 PM
To: [hidden email]
Subject: GridColumn and dataProvider update

Hello,

in a Spark GridColumn, how to detect if the DataGrid.dataProvider has been updated ?

/<s:DataGrid id="dg" x="100" y="48" selectionMode="multipleRows"
requestedRowCount="4">
        <s:columns>
                <s:ArrayList>
                        <s:GridColumn dataField="myBoolean">
                                <s:itemRenderer>
                                        <fx:Component>
                                                <s:GridItemRenderer>
                                                        <fx:Script>
                                                               
                                                        </fx:Script>
                                                        <s:CheckBox id="cb" label="" horizontalCenter="0"
change="data.myBoolean=cb.selected;"/>
                                                </s:GridItemRenderer>
                                        </fx:Component>
                                </s:itemRenderer>
                        </s:GridColumn>
                <s:GridColumn dataField="dataField1" headerText="Column 1"></s:GridColumn>
                <s:GridColumn dataField="dataField2" headerText="Column 2"></s:GridColumn>
                <s:GridColumn dataField="dataField3" headerText="Column 3"></s:GridColumn>
                </s:ArrayList>
        </s:columns>
        <s:typicalItem>
                <fx:Object dataField1="Sample Data" dataField2="Sample Data"
dataField3="Sample Data"></fx:Object>
        </s:typicalItem>
        <s:ArrayCollection>
                <fx:Object dataField1="data1" dataField2="data1"
dataField3="data1"></fx:Object>
                <fx:Object dataField1="data2" dataField2="data2"
dataField3="data2"></fx:Object>
                <fx:Object dataField1="data3" dataField2="data3"
dataField3="data3"></fx:Object>
                <fx:Object dataField1="data4" dataField2="data4"
dataField3="data4"></fx:Object>
        </s:ArrayCollection>
</s:DataGrid>/

thanks




--
Sent from: http://apache-flex-users.2333346.n4.nabble.com/