Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    ListGrid scrolling

    I have a listgrid which isn't scrolling smoothly. When scrolling down, the records "jump" to different position. It is difficult to explain but after testing a lot I have a testcase:

    Code:
    public class TestingModule implements EntryPoint {
    
    	@Override
    	public void onModuleLoad() {
    
    		ListGrid lg = new ListGrid();
    		lg.setDataSource(DataSource.get("table"));
    
    		lg.setCanExpandRecords(true);
    
    		ListGridField idField = new ListGridField("f_name");
    		idField.setTitle("name");
    
    		lg.setFields(idField);
    
    		lg.setWidth100();
    		lg.setHeight100();
    
    		final VStack layout = new VStack(10);
    		layout.setWidth100();
    		layout.setHeight100();
    		layout.setMembers(lg);
    
    		lg.fetchData();
    
    		layout.draw();
    	}
    
    }
    The "table" datasource is nothing special:
    Code:
    <DataSource ID="table" serverType="sql" tableName="t_schueler"
    	 >
    	<fields>
    		<field name="f_schueler_id" type="sequence" primaryKey="true" />
    		<field name="f_name" type="text" />
     	</fields>
    
    </DataSource>
    When scrolling down, as I said, the records jump to an upper position, so the scrolling is not smooth.
    If I remove this:
    lg.setCanExpandRecords(true);
    then the scrolling is smooth again.
    So I guess there is a bug with record expansion.

    Using smartGWT 4.1p: SmartClient Version: v9.1p_2014-10-28/PowerEdition Deployment (built 2014-10-28).

    #2
    Hi edulid,

    this is related to virtual scrolling. See this thread for a similar issue and discussion.

    Best regards,
    Blama

    Comment


      #3
      I am not sure this is related to that thread.

      I do not have having variable height rows , and the height of the rows is the same ... so I think this is a bug. Just try the test case with and without lg.setCanExpandRecords(true); and you will see the difference.

      Comment


        #4
        Hi edulid,

        I know the exact effect. It happens when Virtual Scrolling is enabled (either implicit or explicit) and I don't think there is anything we can do about it.

        Reading the docs for ListGrid.setCanExpandRecords()
        When set to true, shows an additional field at the beginning of the field-list (respecting RTL) to allow users to expand and collapse individual records. See ListGrid.expandRecord and expansionMode for details on record expansion.

        If expanded records will be variable height, you should switch on virtualScrolling.
        it does not seem that setting setCanExpandRecords(true) will automatically enable Virtual Scrolling - but just to be sure, could you check with ListGrid.getVirtualScrolling() for an already drawn ListGrid?

        Best regards,
        Blama

        Comment


          #5
          Having lg.setCanExpandRecords(true); uncommented, the getVirtualScrolling() returns true.
          Having lg.setCanExpandRecords(true); commented out, the getVirtualScrolling() returns null.

          Why is the virtual scrolling enabled automatically by just enabling setCanExpandRecords(true) ? The heights of the rows are the same, or may be calculated in advance, as they are calculated for the listgrid with this setting turned off ?

          Comment


            #6
            Hi edulid,

            this is to decide for Isomorphic where the error is. As the behaviour contradicts the docs, either is wrong.

            Does setting setFixedRecordHeights() change anything? From the docs it does not seem that it is related (also understandable, you would need a height for unexpanded and a height for expanded records), but it is worth a try.

            Best regards,
            Blama

            Comment


              #7
              Originally posted by Blama View Post
              Does setting setFixedRecordHeights() change anything?
              No, the behavior is the same.

              Comment


                #8
                When canExpandRecords is true, virtual scrolling is enabled (if incremental rendering is active) to account for the fact that some rows may be expanded and others not, so we have essentially variable row heights across different rows.
                We'll review the docs and see if we need to clarify this.

                As an aside - the height of expanded rows can differ depending on the expansion component that gets rendered into the row -- as such, we can't really avoid the virtual scrolling requirement when canExpandRecords is true (except possibly in some limited set of cases - not something we are currently intending to pursue).


                We're confused by this assertion:
                When scrolling down, as I said, the records jump to an upper position, so the scrolling is not smooth.
                Virtual Scrolling is a mechanism to avoid rows appearing to "jump around" as the user moves the scrollbar. So it sounds like in your usage this is either not enabled or failing to behave as it should. Or possibly we're misunderstanding your description.
                If this is still an issue for you, would it perhaps be possible to record a short screencast showing the interaction where the rows "jump around"?

                Thanks
                Isomorphic Software

                Comment


                  #9
                  Originally posted by Isomorphic View Post
                  Virtual Scrolling is a mechanism to avoid rows appearing to "jump around" as the user moves the scrollbar. So it sounds like in your usage this is either not enabled or failing to behave as it should. Or possibly we're misunderstanding your description.
                  If this is still an issue for you, would it perhaps be possible to record a short screencast showing the interaction where the rows "jump around"?

                  Thanks
                  Isomorphic Software
                  I can record a short screencast, ok, .. but don't you observe this behavior when executing my testcase scrolling down the list ?

                  Comment


                    #10
                    The test case shows just a simple ListGrid bound to a dataSource with canExpandRecords set to true, and really no other special modifications.
                    Scrolling appears to be working ok for us with that same setup. A screencast seems like the quickest way to clarify what effect you're seeing that you're describing as the records jumping up, as well as possibly give us an idea of anything we might be missing, like roughly how many rows you have in your grid, with the sizing looks like, what skin you're using, what browser you're testing on, etc.

                    Regards
                    Isomorphic Software

                    Comment

                    Working...
                    X