I'm sure I'm just looking in the wrong direction, someone can give me a tip on how to customize the context menu that pops up when a user richgt-click on the column header of a table ?
Thanks
I've checked out the SVN version and now i can customize the context menu. But for various reasons in my application we have decided to not utilize right-click because they are not suited for mobile devices with touchscreens. So I'm trying to override the left-click event and display a menu that is similar to the context menu with this code:
table.addTableListener(new TableListener() { Delete a column from a table in Microsoft Word 2007:: resize tables, add or remove rows, add new columns, and delete existing columns. This tutorial will explain both how to delete the content of a http://freewindowsvistatutorials.com/programsAndApplications/micrleteColumnsFromTables.phpHOME | - XHTML Tables Module:: A table may either contain a single implicit column group (no type of query, the table model allows authors to place cell headers and data http://www.w3.org/TR/2004/WD-xhtml2-20040722/mod-tables.htmlHOME |
@Override
public void tableColumnClick(TableEvent te) {
super.tableColumnClick(te);
te.doit = false;
Menu menu = new Menu();
menu.add(new MenuItem("Sort UP"));
menu.add(new MenuItem("Sort DOWN"));
menu.add(new MenuItem("Hide"));
menu.showAt(te.getClientX(), te.getClientY());
}
});problem is that getClientX and getclientY is always -1 and te.event is always null. What am I doing wrong this time ?
Thank you, I'll try it out asap.
You can listen for the ContextMenu event on Table. Within your listener, you can call table.getContextMenu to get a reference to the Menu and can modify as needed.
I gave you bad advise for the header context menu. I added a new event for HeaderContextMenu. With the latest SVN code you can do this:
tbl.addListener(Events.HeaderContextMenu, new Listener() {
public void handleEvent(TableEvent be) {
Menu menu = be.menu;
Info.display("Event", "Context menu event");
}
});
You are getting -1 values because the DOM event was not being passed in the event. This is fixed in SVN.
I've got some problems implementing it, I've tryed this piece of code
table.addListener(Events.ContextMenu, new Listener() {
public void handleEvent(TableEvent be) {
Info.display("Event", "Context menu event");
}
} );
but the Info is never displayed
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|