SmartGWT - 如何检查 ListGridRecord 是否展开或折叠?

SmartGWT - how to check if ListGridRecord is expanded or collapsed?

我自定义了ListGrid,里面可以展开记录,显示展开组件。我知道记录的左上角有指向 expand/collapse 记录的小箭头,但我想知道是否可以手动检查所选记录是展开还是折叠。我希望在单击单个记录时将记录设为 expand/collapse。我的代码示例:

private RecordClickHandler gatherRecordClickHandler() {
    return new RecordClickHandler() {

        @Override
        public void onRecordClick(RecordClickEvent event) {
            //Here i want to check if the record is expanded/collapsed
            if(/*expanded check method here*/)
                collapseRecord(event.getRecord());
            else
                expandRecord(event.getRecord());
        }
    };
}

试试这个:

if(myListGrid.isExpanded(event.getRecord))
    collapseRecord(event.getRecord());
else
    expandRecord(event.getRecord());