5 Replies Latest reply on Mar 25, 2014 5:11 AM by Ahmed Imran A K

    Problem with scrolling in ADG

    olegkon Level 1

      Hi,

       

      I have a pretty fancy AdvancedDataGrid with itemRenderers, showing/hiding buttons inside, with ArrayCollection as a dataProvider

      to which I add few rows (blank ones). Added filterFunction (but don't think it's related, it happens even when it is not used).

      It used to work fine.

      But recently I started getting problem with vertical scrolling:

      some rows disappear, I am getting lots of blank space on top (which increases the more times you scroll down and back up),

      some rows jump on top of each other.

      It seems if you scroll very slow, it at times restores to original proper view.

       

      I do nothing with regard to scrolling (no event handling), do not even specify vertical scrollbar policy or anything -

      since server returns 63 rows of data, it doesn't fit vertically, so it shows a vertical scroll bar.

       

      Any idea what might be happening?

      And how to fix it?

      What are the suspects?

       

      Using Flex 4.6 with FB4.5 (same in original Flex4.5).

       

      Please advise.

       

       

      TIA,

      Oleg.

        • 1. Re: Problem with scrolling in ADG
          Nirmalya Saha

          In the itemRenderers, put the below code

           

          override public function set data(value:Object):void
          {
               super.data = value;  
               if(value == null)    
               return;

          }

           

          may be this will help.

          • 2. Re: Problem with scrolling in ADG
            Ahmed Imran A K

            Hi All,

             

            I have a similar issue as stated below.

             

            AdvanceDataGrid with simple rows of text values.

             

            On vertical scroll and move upwards, the some of the values at the top goes blank intermittently.

             

            Have used itemRenderer to populate the values to that particluar column.

             

            To fix this issue, I have tried the fixes as below but its not working:

             

            1) super.data=value.

             

            2) Used validate.now().

             

            Can you please give me a solution to this?

             

            Thanks,

            IRK.

            • 3. Re: Problem with scrolling in ADG
              Flex harUI Adobe Employee

              Are you using a custom item renderer?  Post the code for it.

              • 4. Re: Problem with scrolling in ADG
                Ahmed Imran A K Level 1

                Code in UI Page:

                 

                <mx:columns>

                      <mx:AdvancedDataGridColumn id="titleColumn" headerText="Group" minWidth="120" width="120"

                               itemRenderer="com.omnitracs.qdc.workflow.appview.renderers.GroupsTitleItemRenderer"

                               fontSize="11" />

                 

                Code for Item Renderer:

                 

                <![CDATA[

                   import com.omnitracs.qdc.workflow.entities.WFGroup;

                   import com.omnitracs.qdc.workflow.model.ApplicationIconConstants;

                   import mx.controls.Label;

                   import spark.components.Image;

                  

                   [Bindable] private var group:WFGroup;

                   private var filterTypeIcon:Image;

                   private var grpName:Label;

                  

                   override public function set data(value:Object):void

                   {

                    // cannot use dynamic id creation for itemrenderer so create and add elements here

                   

                    if (value != null)

                    {

                     super.data = value;

                     iconContainer.removeAllElements();

                     group = value as WFGroup;

                     if (group.isDefault) {

                      filterTypeIcon = new Image();    

                      filterTypeIcon.source = ApplicationIconConstants.DEFAULT_IMAGE;

                      iconContainer.addElement(filterTypeIcon);

                     } 

                     grpName = new Label();

                     grpName.width = this.width;

                     grpName.text = value.title;

                     grpName.truncateToFit = true;

                     grpName.toolTip = value.title;

                     iconContainer.addElement(grpName);

                    }         

                   }

                • 5. Re: Problem with scrolling in ADG
                  Ahmed Imran A K Level 1

                  Hi All,

                   

                  Setting the width explicitly solved my issue.

                   

                  grpName.width = 120;

                   

                  Thanks,

                  IRK