3 Replies Latest reply on May 27, 2008 3:13 AM by atta707

    checkbox renderer problem

    smscentral Level 1
      Hi all,

      I have a checkbox renderer in datagrid .The dataprovider does not have the selected property of the checkbox.
      how do i retain the selection of the checkbox,when i scroll the datagrid?

      please help.

      Thanks









        • 1. Re: checkbox renderer problem
          atta707 Level 2
          is it possible for you to edit the objects in the dataprovider and add this new property? If so, that would be easiest way to do it.
          • 2. Re: checkbox renderer problem
            smscentral Level 1
            thank u very much..
            in set data method,i added the following

            override public function set data(value:Object):void{
            if(value != null){
            super.data = value;
            }
            if((data.chkselected==null) || (data.chkselected=="undefined")){
            data.chkselected = false;
            }
            this.selected = data.chkselected;
            }
            this works when i change checkbox selection in each row..

            i have another problem..can u please help me in solving this
            i have a checkbox as header renderer..
            On click, it is selectiing/deselecting only the checkboxes of rows which are visible and when i scroll the datagrid,other checkboxes are not selected/deselected

            thanks





            • 3. Re: checkbox renderer problem
              atta707 Level 2
              override public function set data(value:Object):void{

              super.data = value;

              if((data.chkselected==null) || (data.chkselected=="undefined")){
              data.chkselected = false;
              }
              else {
              data.chkselected = true;
              }

              this.selected = data.chkselected;