How do I implement a HeaderSpan Event Handler, which can change the current columns show/hide, or add/remove columns ?
just like http://www.smartclient.com/#analytics
just like http://www.smartclient.com/#analytics
protected MenuItem[] getHeaderSpanContextMenuItems(HeaderSpan headerSpan)
final ListGrid countryGrid = new ListGrid() { @Override protected MenuItem[] getHeaderSpanContextMenuItems(final HeaderSpan headerSpan) { final MenuItem[] items = super.getHeaderSpanContextMenuItems(headerSpan); MenuItem customItem = new MenuItem("Custom MenuItem for " + headerSpan.getTitle()); customItem.addClickHandler(new ClickHandler() { public void onClick(MenuItemClickEvent event) { SC.say("Custom MenuItem click on " + headerSpan.getTitle()); } }); MenuItem[] newItems = new MenuItem[items.length + 1]; for (int i = 0; i < items.length; i++) { MenuItem item = items[i]; newItems[i] = item; } newItems[items.length] = customItem; return newItems; } };
Comment