Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Nested Grid scroll bug

$
0
0
I'm using smartgwt version 4.1-p and testing on IE11

Error comes when nesting a grid that's wider than the parent grid. Scroll bars appear but when trying to scroll they keep jumping back to the left side.

Test code is the same as your nested grid showcase, Just changed the width of the inner grid to 2000px.






package com.dotcode.sd.client;

import com.google.gwt.core.client.EntryPoint;
import com.smartgwt.client.data.DataSource;
import com.smartgwt.client.types.Alignment;
import com.smartgwt.client.types.ExpansionMode;
import com.smartgwt.client.types.ListGridEditEvent;
import com.smartgwt.client.types.RowEndEditAction;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.IButton;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.grid.ListGridRecord;
import com.smartgwt.client.widgets.layout.HLayout;
import com.smartgwt.client.widgets.layout.VLayout;


/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
public class SmartGWT implements EntryPoint {

public void onModuleLoad() {
DataSource dataSource = SupplyCategoryXmlDS.getInstance();

ListGrid listGrid = new ListGrid() {
public DataSource getRelatedDataSource(ListGridRecord record) {
return ItemSupplyXmlDS.getInstance();
}

@Override
protected Canvas getExpansionComponent(final ListGridRecord record) {

VLayout layout = new VLayout(5);
layout.setPadding(5);

final ListGrid countryGrid = new ListGrid();
countryGrid.setWidth(2000);
countryGrid.setHeight(224);
countryGrid.setCellHeight(22);
countryGrid.setDataSource(getRelatedDataSource(record));
countryGrid.fetchRelatedData(record, SupplyCategoryXmlDS.getInstance());

countryGrid.setCanEdit(true);
countryGrid.setModalEditing(true);
countryGrid.setEditEvent(ListGridEditEvent.CLICK);
countryGrid.setListEndEditAction(RowEndEditAction.NEXT);
countryGrid.setAutoSaveEdits(false);

layout.addMember(countryGrid);

HLayout hLayout = new HLayout(10);
hLayout.setAlign(Alignment.CENTER);

IButton saveButton = new IButton("Save");
saveButton.setTop(250);
hLayout.addMember(saveButton);

IButton discardButton = new IButton("Discard");
hLayout.addMember(discardButton);

IButton closeButton = new IButton("Close");
hLayout.addMember(closeButton);

layout.addMember(hLayout);

return layout;
}
};

listGrid.setWidth(600);
listGrid.setHeight(500);
listGrid.setDrawAheadRatio(4);
listGrid.setCanExpandRecords(true);

listGrid.setAutoFetchData(true);
listGrid.setDataSource(dataSource);

listGrid.draw();
}
}

Viewing all articles
Browse latest Browse all 4756

Trending Articles