0

这是我的代码片段:

    final ListGrid subscriberGrid = new ListGrid();
    subscriberGrid.setWidth(500);
    subscriberGrid.setHeight(224);
    subscriberGrid.setShowAllRecords(true);
    subscriberGrid.setSelectionType(SelectionStyle.SIMPLE);
    subscriberGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);

    ListGridField fnField = new ListGridField("fn", "First Name");
    ListGridField lnField = new ListGridField("ln", "Last Name");
    ListGridField emailField = new ListGridField("email", "E-mail");
    subscriberGrid.setFields(fnField, lnField, emailField);

如何为其输入值?我尝试启动 ListGridRecord[],但无法正确填充任何值。我也尝试过使用 Javascript 对象,但这也给了我一个错误。谷歌搜索也没有返回令人满意的结果。

TIA。

4

1 回答 1

2

啊该死。我问了之后得到了答案。

        ListGridRecord temp = new ListGridRecord();

        temp.setAttribute("fn", "foo");
        temp.setAttribute("ln", "bar");
        temp.setAttribute("email", "baz");

        ListGridRecord[] record = { temp };

        subscriberGrid.setData(record);

抱歉打扰了^-^

于 2010-10-20T13:01:50.283 回答