Skip to main content



      Home
Home » Eclipse Projects » NatTable » change active cell
change active cell [message #1436017] Thu, 02 October 2014 05:06 Go to next message
Eclipse UserFriend
Hello,

i have a table with spanned content.
The content is editable.

Now my problem is that if there are 5 cells spanned, the user clicks in cell 4, my textCellEditor opens in cell 4. I want that the textCellEditor opens in cell 1.

Is this possible?

actual state:
1 span
2 span
3 span
4 span --> click4 --> edit4
5 span

target state
1 span ----------------> edit1
2 span
3 span
4 span --> click4
5 span

best regards
Fabian
Re: change active cell [message #1436187 is a reply to message #1436017] Thu, 02 October 2014 10:28 Go to previous messageGo to next message
Eclipse UserFriend
When implementing your custom editor you could overwrite the ICellEditor#calculateControlBounds and return a rectangle indicating the position of your desired cell. The editor will be opened at the position that is described by the rectangle.

We are doing the same in our application to move the editor. Works perfect Smile
Re: change active cell [message #1436193 is a reply to message #1436187] Thu, 02 October 2014 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Okay i try this
Re: change active cell [message #1436363 is a reply to message #1436193] Thu, 02 October 2014 16:11 Go to previous messageGo to next message
Eclipse UserFriend
Hm, which version of NatTable are you using? I thought I fixed some issue with editing spanned cells so the whole spanned cell borders are used for the editor.

Have a look at Tutorial Examples -> Layers -> Data -> SpanningDataLayerExample ... if you click on a spanned cell, editing is activated and the whole 4 spanned cells are used for the editor borders.
Re: change active cell [message #1438534 is a reply to message #1436363] Mon, 06 October 2014 02:59 Go to previous messageGo to next message
Eclipse UserFriend
Hello Dirk,

I'm using the Version 1.1.0.
I do it like the example, creating a class which implements IDataProvider and ISpanningDataProvider


public class SpanningBodyDataProvider implements IDataProvider, ISpanningDataProvider
Re: change active cell [message #1438604 is a reply to message #1438534] Mon, 06 October 2014 05:05 Go to previous messageGo to next message
Eclipse UserFriend
Then I don't know why in your case only one cell in the span is activated for editing instead of one big spanned editor.

Have you checked that the editor configurations are applied correctly?
Re: change active cell [message #1438705 is a reply to message #1438604] Mon, 06 October 2014 07:37 Go to previous message
Eclipse UserFriend
Now it works.
There was an error in my EventListener.

Thanks for your help, you showed me that it was not a natTable error but rather my fault.

best regards
Fabian
Previous Topic:IConfiguration initialized multiple times
Next Topic:Nattable css engine
Goto Forum:
  


Current Time: Tue Jul 01 15:30:01 EDT 2025

Powered by FUDForum. Page generated in 0.04023 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top