在ListGrid的一行上侦听Click事件

时间:2012-10-08 16:32:45

标签: gwt smartgwt

是否可以在ListGrid的一行上侦听点击事件?如果是,我该怎么办?

2 个答案:

答案 0 :(得分:4)

@Manu或者您可以执行以下操作:

listGrid.addRecordClickHandler(new RecordClickHandler() {
        @Override
        public void onRecordClick(RecordClickEvent event) {
            // your code
        }
});

答案 1 :(得分:0)

ListGridField[] listGridFields = listGrid.getFields();
for (ListGridField listGridField : listGridFields) {

  listGridField.addRecordClickHandler(new RecordClickHandler() {

    @Override
    public void onRecordClick(RecordClickEvent event) {
      evaluator.recordClicked(event.getRecord());
    }
  });

}

有更好的方法吗?