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

Sorting breaks resizing #10

Open
sofoklisM opened this issue Dec 30, 2014 · 0 comments
Open

Sorting breaks resizing #10

sofoklisM opened this issue Dec 30, 2014 · 0 comments

Comments

@sofoklisM
Copy link

Sorting in data grid breaks resizing.

For one thing the the offset and width of the header are incorrect once the header is sorted.
But what's worse is that DataGrid does not propagate the events to the Header because
headerBuilder.isHeader returns false for a column that's sorted.
That seems to me like DataGrid bug.

That's from AbstractCellTable.onBrowserEvent2

    /*
     * Look for the most immediate header parent if not already found. Its
     * possible that the footer or header will mistakenly identify a header
     * from the other section, so we remember both. When we eventually reach
     * the target table section element, we'll know for sure if its a header
     * of footer.
     */
    if (headerParent == null && headerBuilder.isHeader(cur)) {
      headerParent = cur;
    }

   ....
  boolean shouldSortColumn = true;
  // Fire the event to the header.
  if (headerParent != null) {
    Header<?> header =
        isHeader ? headerBuilder.getHeader(headerParent) : footerBuilder
            .getHeader(footerParent);

    if (header != null) {
      int headerIndex = isHeader ? headerBuilder.getRowIndex(targetTableRow) :
          footerBuilder.getRowIndex(targetTableRow);
      Context context = new Context(headerIndex, col, header.getKey());

      if (cellConsumesEventType(header.getCell(), eventType)) {          
        header.onBrowserEvent(context, headerParent, event);
      }

      if (isSelect) {
        // Preview the event, and possibily disable the column sort event. The event preview is
        // forced even if the header cell does not consume click event
        shouldSortColumn = header.onPreviewColumnSortEvent(context, headerParent, event);
      }
    }
  }
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

1 participant