2 Replies Latest reply on Mar 7, 2010 9:19 PM by venkatsyss

    Regarding - Amfphp

    venkatsyss Level 1

      hi,

       

      i am using amfphp to display the records in the datagrid in flex.

       

      My question is ,while i have calling a function in a button it needs to select all the checkbox in the datagrid.

       

      i could n't know how to solve the problem.

       

      Please provide me the solution to solve the problem.

       

      Thanks and Regards,

      venkat.R

        • 1. Re: Regarding - Amfphp
          Flex harUI Adobe Employee

          It depends on how you did the checkboxes.  If you use the example on my

          blog, the checkbox header has code that checks all the checkboxes.

           

           

          --

          Alex Harui

          Flex SDK Team

          Adobe System, Inc.

          http://blogs.adobe.com/aharui

          • 2. Re: Regarding - Amfphp
            venkatsyss Level 1

            hi,

             

            thanks for you reply but i could not know how to solve the problem.

             

             

            The Follwing code shows:

             

            <mx:DataGrid id="myDg">
            <mx:columns>
                <mx:DataGridColumn dataField="selected">
                    <mx:itemRenderer>
                        <mx:Component>
                            <mx:CheckBox selected="{data.sel}"></mx:CheckBox>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
                <mx:DataGridColumn dataField="emp_name"></mx:DataGridColumn>
                <mx:DataGridColumn dataField="emp_email"></mx:DataGridColumn>
                <mx:DataGridColumn dataField="emp_state"></mx:DataGridColumn>
            </mx:columns>
               
            </mx:DataGrid>

             

            <mx:RemoteObject id="myService" destination="AMFPHP" source="echoService" endpoint="http://localhost/amfphp/gateway.php">
                    <mx:method name="selectAll" result="Result()">
                   
                    </mx:method>
                  
                </mx:RemoteObject>

             

             

            <mx:Button label="sample" click="handleSelect(true)"></mx:Button>

             

            private function handleSelect(value:Boolean):void{
                            var len:int=myService.selectAll.lastResult.length;
                            for(var i:int=0 ; i<len;i++ ){
                                    myDg[i].checked=value;
                               
                            }
                        }

            But i could not able to check all the checkbox in a datagrid.

             

            please find me the solution to solve the problem.

             

            Thanks and Regards,

            venkat.R