Skip to main content



      Home
Home » Eclipse Projects » NatTable » Dynamically set column span for a cell(i want to randomly set column span for a cell based on value in other column)
Dynamically set column span for a cell [message #1800783] Tue, 08 January 2019 03:52 Go to next message
Eclipse UserFriend
My requirement is to based on a value selected in a column of nattable, i want to set a custom text by merging few other column and make it non-editable.

i am able to achieve the non-editable cell using label configuration but i am not able to achieve row spanning / merging dynamically,

i have defined in my get cell as:

public DataCell getCellByPosition(int columnPosition, int rowPosition)
{
int columnSpan = 1;
int rowSpan = 1;
int cellColumnPosition = columnPosition;
int cellRowPosition = rowPosition;

//Merge the load current cells if component is excluded from fuse size analysis
if(rowObj.isExcludedFromFuseSizeAnalysis())
{
if(cellColumnPosition == gfsConstant.NOM_COL_IDX)
{
columnSpan = 6;
}
}
return new DataCell(cellColumnPosition, cellRowPosition, columnSpan, rowSpan);
}


when i save the data in database and after i reload the table the span is showing correctly, but i want it to display as soon as i edit the property in other column.

Can someone please help me in how to achieve this.

  • Attachment: Capture.PNG
    (Size: 14.70KB, Downloaded 161 times)
Re: Dynamically set column span for a cell [message #1800785 is a reply to message #1800783] Tue, 08 January 2019 04:41 Go to previous message
Eclipse UserFriend
I suppose you need to trigger a NatTable#refresh() after updating the value. You should be able to do this by either registering a custom UpdateDataCommandHandler to the body DataLayer or by registering a listener for a DataUpdateEvent that triggers the refresh if the update contains the value. At least that would be my assumption without seeing any other code or having a simple example to reproduce this.
Previous Topic:Problem with Column Group Reorder and Column Grouping by Value
Next Topic:Problem with Tree and Hide Row
Goto Forum:
  


Current Time: Tue May 20 18:54:36 EDT 2025

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

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

Back to the top