1 Reply Latest reply: Oct 13, 2013 6:59 PM by huangxinghui RSS

    Issue With select Check box in advance datagrid

    vineet osho Community Member

      Hi

             i am using advance datagrid having hierarichal data.There is one column having checkbox and one header renderer(CheckBox) on top giving functionality of select all.when i clicked on select all checkbox , all the checkboxes in that column not showing checked unless  i collapse or expand the heirarichal data or scroll the advance data grid,similar is the case with unselect checkbox.however internally values are selected and unselected as per functionality but checkboxes are not show checked/unchecked in first go.i have tried following things to refersh the data but nothing worked.

       

      refreshing the arrayCollection and then calling invalidateList() on the grid.

      IHierarchicalCollectionView(adg.dataProvider).refresh();

      so please  guide me .

       

       

      Thanks in advance

        Vineet Osho

        • 1. Re: Issue With select Check box in advance datagrid
          huangxinghui Community Member

          we have a field to bind the checkbox selected status, such as 'selected', when the data['selected'] = true means the checkbox is checked, otherwise is unchecked

           

          the itemrenderer code:

           

          public class CheckBoxADGItemRenderer extends CenteredCheckBox
                    {
                              public function CheckBoxADGItemRenderer()
                              {
                                        super();
                              }
            
                              override public function set data(value:Object):void
                              {
                                        super.data = value;
            
                                        invalidateProperties();
                              }
            
                              override protected function commitProperties():void
                              {
                                        selected = data['selected'];
                                        super.commitProperties();
                              } 
                    }
          
          

           

          when click the header renderer checkbox, change the collection data 'selected' field, when checked, data['selected'] = true;

           

          then invalidate the check column properties,

           

          eg:

           

          private function invalidateCheckColumnProperties():void
                              {
                                        var i:int = 0;
                                        var n:int = listItems.length;
                                        var instance:IInvalidating;
                                        for (i = 0; i < n; i++)
                                        {
                                                  instance = listItems[i][0] as IInvalidating;
                                                  if (instance)
                                                  {
                                                            instance.invalidateProperties();
                                                  }
                                        }
                              }
          
          

           

          Hope help for your.

           

          Huang