columnMetaList.add( columnMeta );
dataGrid.addColumn( columnMeta.getColumn(), columnMeta.getHeader() );
}
public Button createToggleButton() {
final Button button = new Button();
button.setToggle( true );
button.setIcon( IconType.LIST_UL );
popup.getElement().getStyle().setZIndex( Integer.MAX_VALUE );
popup.addAutoHidePartner( button.getElement() );
popup.addCloseHandler( new CloseHandler<PopupPanel>() {
public void onClose( CloseEvent<PopupPanel> popupPanelCloseEvent ) {
if ( popupPanelCloseEvent.isAutoClosed() ) {
button.setActive( false );
}
}
} );
button.addClickHandler( new ClickHandler() {
public void onClick( ClickEvent event ) {
if ( !button.isActive() ) {
showColumnPickerPopup( button.getAbsoluteLeft(),
button.getAbsoluteTop() + button.getOffsetHeight() );
} else {
popup.hide( false );
}
}
} );