0 Replies Latest reply on Mar 8, 2010 8:38 AM by venkatsyss

    Regarding - Amfphp

    venkatsyss

      hi,

       

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

       

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

       

       

      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.

       

       

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

       

      please find me the solution to solve the problem.

       

       

       

      Thanks and Regards,

       

      venkat.R