我正在编写一个非常简单的 SmartGWT 应用程序,它在本地使用 100 个元素填充列表网格(不涉及 RPC 或任何服务器交互)。
当我滚动列表网格时,滚动速度明显变慢
环境:SmartGWT 3.0 GWT 2.4.0
代码如下:
public class RemoteFileBrowser implements EntryPoint {
// /**
// * The message displayed to the user when the server cannot be reached or
// * returns an error.
// */
// private static final String SERVER_ERROR = "An error occurred while "
// + "attempting to contact the server. Please check your network "
// + "connection and try again.";
//
// /**
// * Create a remote service proxy to talk to the server-side Greeting
// service.
// */
// private final RemoteFileServiceAsync greetingService = GWT
// .create(RemoteFileService.class);
/**
* This is the entry point method.
*/
public void onModuleLoad() {
//// SC.say("Welcome to remote file browser!");
// RemoteFileDialog rfDialog = new RemoteFileDialog("*.*, *.htm, *.cpp, *.hpp");
// rfDialog.show();
getListView().draw();
}
private ListGrid getListView() {
ListGrid grid = new ListGrid();
grid.setWidth(500);
grid.setHeight(400);
grid.setLeft(100);
grid.setTop(100);
ListGridField field1 = new ListGridField("name");
ListGridField field2 = new ListGridField("designation");
grid.setFields(field1, field2);
ListGridRecord[] records = new ListGridRecord[100];
for (int i=0; i<100; ++i) {
//ListGridRecord record = new ListGridRecord();
records[i] = new ListGridRecord();
GWT.log("Iteraton:" + i);
records[i].setAttribute("name", "name" + i);
records[i].setAttribute("designation", "designation" + i);
}
grid.setData(records);
return grid;
}
}
展示示例似乎工作正常。当我在本地填充列表网格而不设置数据源时,就会出现问题。
任何想法,我在哪里弄错了?
提前感谢您的帮助。
问候,房车