Grid, Template and selected row image [message #1785204] |
Tue, 10 April 2018 19:53 |
Frank.K Mising name Messages: 15 Registered: January 2013 |
Junior Member |
|
|
In our application we are using a Grid with a Template that consists out of several TextCells and one ImageCell.
Everything works pretty well so far, but we couldn't find a way to exchange the image in selected state.
Reason why we like to change the image is that it is very dark, which works good on brighter backgrounds, but is barely visible, when a row was selected.
We already have the images in a white and a black version, but anything similar e.g. simply inverting it would do the trick, too.
[Updated on: Tue, 10 April 2018 22:04] Report message to a moderator
|
|
|
|
Re: Grid, Template and selected row image [message #1785240 is a reply to message #1785221] |
Wed, 11 April 2018 11:37 |
Frank.K Mising name Messages: 15 Registered: January 2013 |
Junior Member |
|
|
Thanks Ivan,
I'm trying to use client scripting, but I'm already stuck at the beginning. Seems my simple ClientListener is never called, i.e. I don't see any log output in the browser console.
Just for testing I've also added a simple selection listener. This way I can see the log output "test2" for each selection change, but no "test".
grid = new Grid(twoColum, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
viewer = new GridTableViewer(grid);
grid.setData(RWT.MARKUP_ENABLED, Boolean.TRUE);
grid.setItemHeight(ROW_HEIGHT);
Template template = new Template();
[ template stuff ]
grid.setData(RWT.ROW_TEMPLATE, template);
grid.addListener(SWT.Selection, new Listener()
{
@Override
public void handleEvent(final Event event)
{
JavaScriptExecutor executor = RWT.getClient().getService(JavaScriptExecutor.class);
executor.execute("console.log(\"test2\");");
}
});
grid.addListener(SWT.Selection,
new ClientListener("function handleEvent(event){console.log(\"test\"); };"));
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03353 seconds