Skip navigation
Currently Being Moderated

Issue With select Check box in advance datagrid

Oct 12, 2013 10:37 AM

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

 
Replies
  • Currently Being Moderated
    Oct 13, 2013 6:59 PM   in reply to vineet osho

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points