1

我是 GXT 新手,我正在使用 GXT 2.0.1 开发一个项目。我想为列表视图设置字段标签。如何设置字段标签。?

ListView<Stock> list2 = new ListView<Stock>();
    list2.setDisplayProperty("name");
    store = new ListStore<Stock>();
    store.setStoreSorter(new StoreSorter<Stock>());
    list2.setStore(store);
4

2 回答 2

1

您可以将其包装ListView在 a 中ContentPanel,然后设置标题:

ContentPanel cp = new ContentPanel();
cp.setHeading("Stocks");
cp.setLayout(new FitLayout());
cp.add(list2);
add(cp);
于 2010-09-22T15:34:07.647 回答
0

在您的字段上使用 ListField 调用 setFieldLabel("name")。确保将其添加到具有 FormLayout 的容器中。

于 2010-09-24T19:47:36.327 回答