Announcement

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

    ListGrid with setShowRecordComponents does not scroll down to end with scrollToRow(10000)

    Hi Isomorphic,

    I have a recordComponent enabled ListGrid ordered by date where I want to show the newest entries on load (=scroll to the very bottom).
    While creating this testcase I found out that disabling virtualScrolling fixes my issue.
    Therefore this has no priority for me, but is an bug nevertheless I assume. Please see the scrolling positions for the calls with virtualScrolling=true. Setting recordComponentHeight did not make a difference.

    See this BuiltInDS-based testcase (v10.1p_2017-10-05):
    Code:
    package com.smartgwt.sample.client;
    
    import com.google.gwt.core.client.EntryPoint;
    import com.smartgwt.client.Version;
    import com.smartgwt.client.core.KeyIdentifier;
    import com.smartgwt.client.data.DSCallback;
    import com.smartgwt.client.data.DSRequest;
    import com.smartgwt.client.data.DSResponse;
    import com.smartgwt.client.data.DataSource;
    import com.smartgwt.client.types.RecordComponentPoolingMode;
    import com.smartgwt.client.util.Page;
    import com.smartgwt.client.util.PageKeyHandler;
    import com.smartgwt.client.util.SC;
    import com.smartgwt.client.widgets.IButton;
    import com.smartgwt.client.widgets.Window;
    import com.smartgwt.client.widgets.events.ClickEvent;
    import com.smartgwt.client.widgets.events.ClickHandler;
    import com.smartgwt.client.widgets.grid.ListGrid;
    import com.smartgwt.client.widgets.grid.ListGridField;
    import com.smartgwt.client.widgets.layout.VLayout;
    
    public class BuiltInDS extends VLayout implements EntryPoint {
        public void onModuleLoad() {
            KeyIdentifier debugKey = new KeyIdentifier();
            debugKey.setCtrlKey(true);
            debugKey.setKeyName("D");
    
            Page.registerKey(debugKey, new PageKeyHandler() {
                public void execute(String keyName) {
                    SC.showConsole();
                }
            });
            setWidth100();
            setHeight100();
            {
                final IButton recreateBtn = new IButton("Recreate normal");
                recreateBtn.setWidth(200);
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        new MyWindow(false, false, false).show();
                    }
                });
                addMember(recreateBtn);
            }
            {
                final IButton recreateBtn = new IButton("Recreate RC, no VS");
                recreateBtn.setWidth(200);
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        new MyWindow(false, true, false).show();
                    }
                });
                addMember(recreateBtn);
            }
            {
                final IButton recreateBtn = new IButton("Recreate RC, with VS");
                recreateBtn.setWidth(200);
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        new MyWindow(false, true, true).show();
                    }
                });
                addMember(recreateBtn);
            }
            {
                final IButton recreateBtn = new IButton("Recreate normal + normal");
                recreateBtn.setWidth(200);
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        new MyWindow(true, false, false).show();
                    }
                });
                addMember(recreateBtn);
            }
            {
                final IButton recreateBtn = new IButton("Recreate normal + RC, no VS");
                recreateBtn.setWidth(200);
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        new MyWindow(true, true, false).show();
                    }
                });
                addMember(recreateBtn);
            }
            {
                final IButton recreateBtn = new IButton("Recreate normal + RC, with VS");
                recreateBtn.setWidth(200);
                recreateBtn.addClickHandler(new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        new MyWindow(true, true, true).show();
                    }
                });
                addMember(recreateBtn);
            }
            draw();
        }
    
        private class MyWindow extends Window {
            public MyWindow(boolean showNormal, boolean useRecordComponents, boolean useVirtualScrolling) {
                setWidth("95%");
                setHeight("95%");
                setMembersMargin(0);
                setModalMaskOpacity(70);
                setTitle(" (" + Version.getVersion() + "/" + Version.getSCVersionNumber() + ")");
                setTitle("ListGrid with setShowRecordComponents does not scroll down to end with scrollToRow(10000)" + getTitle());
                setShowMinimizeButton(false);
                setIsModal(true);
                setShowModalMask(true);
                centerInPage();
                if (showNormal) {
                    final ListGrid SupplyItemLG = new SupplyItemLG(false, false);
                    SupplyItemLG.fetchData(null, new DSCallback() {
                        @Override
                        public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
                            SupplyItemLG.scrollToRow(10000);
                        }
                    });
                    addItem(SupplyItemLG);
                }
                final ListGrid SupplyItemLG = new SupplyItemLG(useRecordComponents, useVirtualScrolling);
                SupplyItemLG.fetchData(null, new DSCallback() {
                    @Override
                    public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
                        SupplyItemLG.scrollToRow(10000);
                    }
                });
                addItem(SupplyItemLG);
            }
        }
    
        private class SupplyItemLG extends ListGrid {
            public SupplyItemLG(boolean useRecordComponents, boolean useVirtualScrolling) {
                super(DataSource.get("supplyItem"));
                setWidth(1000);
                setHeight100();
                setAutoFetchData(false);
                if (useRecordComponents) {
                    setShowRecordComponents(true);
                    setShowRecordComponentsByCell(true);
                    setRecordComponentPoolingMode(RecordComponentPoolingMode.RECYCLE);
                    setPoolComponentsPerColumn(true);
                    setVirtualScrolling(useVirtualScrolling);
                    // setRecordComponentHeight(22);
                }
                ListGridField itemName = new ListGridField("itemName");
                ListGridField sku = new ListGridField("SKU");
                ListGridField category = new ListGridField("category");
                ListGridField units = new ListGridField("units");
                setFields(itemName, sku, category, units);
                setSortField("itemName");
            }
        }
    }
    This code in this sample (v10.1p_2017-10-25) also shows the issue, although it scrolls to a different position than in the testcase above and shows an empty screen.
    Code:
    isc.ListGrid.create({
        ID:"dsListGrid", 
        width: "100%",
        height: 600,
        autoFetchData: false,
        dataSource: "supplyItem",
        showRecordComponents: true,
        virtualScrolling: true,
    });
    
    dsListGrid.fetchData(
    null,
        function (dsResponse, data, dsRequest) {
            dsListGrid.scrollToRow (100000);
        }
    );
    The same code in the same sample in v11.1p_2017-10-26 works as expected.

    Best regards
    Blama

    #2
    Hi Isomorphic,

    the testcase code works as expected in SmartGWT v11.1p_2017-12-29, as well as the 11.1p SmartClient sample (as already written in #1).
    This means that "normal" and "RC, with VS" are both scrolled to the bottom. For "RC, with VS" only the last record is visible as top record because of the white virtualScrolling page at the end.

    I did retest SmartGWT 5.1p today (v10.1p_2017-12-21), and here the issue does still exist. This means, "RC, with VS" does scroll to a completely blank page at the bottom. Please note that this is now minor for me.

    Best regards
    Blama

    Comment

    Working...
    X