Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BaseRenderer#drawRow does not consider column offset #208

Open
GuidoReith opened this issue Jan 27, 2021 · 1 comment
Open

BaseRenderer#drawRow does not consider column offset #208

GuidoReith opened this issue Jan 27, 2021 · 1 comment

Comments

@GuidoReith
Copy link

GuidoReith commented Jan 27, 2021

Having a AbstractDataView (selectionType is not SelectionType.NONE); Turn off some columns and sort the rest gives wrong result:
AbstractDataView#renderRows:337 - setting visible header indexes by method getVisibleHeaderIndexes();
AbstractDataView#getVisibleHeaderIndexes:307 - uses getColumnCount() method;
AbstractDataView#getColumnCount:1275 - returns column count without OFFSET (getColumnOffset());
BaseRenderer#drawRow:135 - drawColumn() method uses as param isHeaderVisible() method with column index without OFFSET (int c);

Fix could be: Change in getVisibleHeaderIndexes():

        protected List<Integer> getVisibleHeaderIndexes() {
		List<Integer> visibleHeaders = new ArrayList<>();
		for (int index = 0; index < getColumnCount() + getColumnOffset(); index++) {
			if (isHeaderVisible(index)) {
				visibleHeaders.add(index);
			}
		}

		return visibleHeaders;
	}

In BaseRenderer#drawRow:135
TableData td = drawColumn(row, context, data, column, colIndex, isHeaderVisible(colIndex));

@BenDol
Copy link
Contributor

BenDol commented Jan 27, 2021

Thanks for reporting, I'll take a look at this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants