1

我自定义了ListGrid,可以在其中展开记录并显示展开组件。我知道记录的左上角存在展开/折叠记录的小箭头,但我想知道是否可以手动检查所选记录是否展开或折叠。我希望记录在单击记录时展开/折叠。我的代码示例:

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());
        }
    };
}
4

1 回答 1

1

尝试这个:

if(myListGrid.isExpanded(event.getRecord))
    collapseRecord(event.getRecord());
else
    expandRecord(event.getRecord());
于 2016-04-08T05:53:50.860 回答