Implementing rowNumber in CompositeTable [message #577273] |
Sun, 04 February 2007 05:13 |
John Ye Messages: 20 Registered: July 2009 |
Junior Member |
|
|
Hi Dave,
I tried to implement row numbers in CompositeTable as follows:
1. Use a label as the first child of my row composite.
2. In the refresh method, set the row number as follows:
public void refresh(CompositeTable sender, int currentObjectOffset,
Control rowControl) {
Row row = (Row) rowControl;
row.rowNumber.setText("" + (currentObjectOffset+1));
3. In the deleteRow method of IDeleteHandler(), add table.refreshAllRows()
at the end.
The problem is that deleteRow is called before deletion actually takes
place. So row numbers are one bigger after the deletion position.
If refreshAllRows() is added after line 1197 of InternalCompositeTable
(line 1197 reads internalSetSelection(currentColumn, currentRow, true);),
then row numbers are working fine and step 3 above is not necessary.
Is there a better way to display row numbers? Any potential problems over
the above change in InternalCompositeTable?
Thanks,
John
|
|
|
Powered by
FUDForum. Page generated in 0.03708 seconds