Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » NatTable » change active cell
change active cell [message #1436017] Thu, 02 October 2014 09:06 Go to next message
Fabian Greiser is currently offline Fabian GreiserFriend
Messages: 7
Registered: September 2014
Junior Member
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 14:28 Go to previous messageGo to next message
Michael Heiß is currently offline Michael HeißFriend
Messages: 19
Registered: November 2013
Location: Graz, Austria
Junior Member
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 14:36 Go to previous messageGo to next message
Fabian Greiser is currently offline Fabian GreiserFriend
Messages: 7
Registered: September 2014
Junior Member
Okay i try this
Re: change active cell [message #1436363 is a reply to message #1436193] Thu, 02 October 2014 20:11 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2495
Registered: July 2012
Senior Member
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 06:59 Go to previous messageGo to next message
Fabian Greiser is currently offline Fabian GreiserFriend
Messages: 7
Registered: September 2014
Junior Member
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 09:05 Go to previous messageGo to next message
Dirk Fauth is currently offline Dirk FauthFriend
Messages: 2495
Registered: July 2012
Senior Member
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 11:37 Go to previous message
Fabian Greiser is currently offline Fabian GreiserFriend
Messages: 7
Registered: September 2014
Junior Member
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: Sun Sep 24 19:39:16 GMT 2017

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

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