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

Table: When creating meta columns, all the widths of the scrollers but the last one are calculated wrong #9309

Open
Plasmodino opened this Issue Apr 3, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@Plasmodino
Contributor

Plasmodino commented Apr 3, 2017

In Scroller.js the PaneWidth is calculated so:

		setPaneWidth: function (width) {
			if (this.isVerticalScrollBarVisible()) {
				width += this.getPaneInsetRight();
			}
			this.setWidth(width);
		},

This happens for all the scroller widths in Table.js:

_updateScrollerWidths : function()
{
  // Give all scrollers except for the last one the wanted width
  // (The last one has a flex with)
  var scrollerArr = this._getPaneScrollerArr();

  for (var i=0; i<scrollerArr.length; i++)
  {
    var isLast = (i == (scrollerArr.length - 1));
    var width = scrollerArr[i].getTablePaneModel().getTotalWidth();
    scrollerArr[i].setPaneWidth(width);

    var flex = isLast ? 1 : 0;
    scrollerArr[i].setLayoutProperties({flex: flex});
  }
},

Solution in Table.js, applyMetaColumnCounts():
Call
this._updateScrollBarVisibility();
before
this._updateScrollerWidths();

Otherwise there is a gap between the meta columns if there is a vertical scrollbar visible in table and you split the table into two meta columns.

@schnepe2

This comment has been minimized.

Show comment
Hide comment
@schnepe2

schnepe2 Apr 12, 2017

Contributor

Hi @Plasmodino,
I've tried to understand what the problem is, but I can't figure it out.
I've created a playground example that uses (a) the original table and (b) your proposed fix.
But I can't see any difference 🤷‍♂️

http://tinyurl.com/kphwgej

The changed playground FixedTable Class looks weird, but as we can't access private members in an overridden _applyMetaColumnCounts method, I've just added a flag to skip the _updateScrollerWidths method when it's called from _applyMetaColumnCounts...
All this should resemble your fix

in Table.js, applyMetaColumnCounts():
Call
this._updateScrollBarVisibility();
before
this._updateScrollerWidths();

So, could you maybe change that playground example, so I (we) can see the problem?
...adding meta columns or whatever triggers the issue...

Contributor

schnepe2 commented Apr 12, 2017

Hi @Plasmodino,
I've tried to understand what the problem is, but I can't figure it out.
I've created a playground example that uses (a) the original table and (b) your proposed fix.
But I can't see any difference 🤷‍♂️

http://tinyurl.com/kphwgej

The changed playground FixedTable Class looks weird, but as we can't access private members in an overridden _applyMetaColumnCounts method, I've just added a flag to skip the _updateScrollerWidths method when it's called from _applyMetaColumnCounts...
All this should resemble your fix

in Table.js, applyMetaColumnCounts():
Call
this._updateScrollBarVisibility();
before
this._updateScrollerWidths();

So, could you maybe change that playground example, so I (we) can see the problem?
...adding meta columns or whatever triggers the issue...

@level420

This comment has been minimized.

Show comment
Hide comment
@level420

level420 Apr 12, 2017

Member

@schnepe2 thank you for looking into this. 👍

Member

level420 commented Apr 12, 2017

@schnepe2 thank you for looking into this. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment