-
Notifications
You must be signed in to change notification settings - Fork 9
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
Implement column grouping #24
Conversation
this.$(cellSelector).toArray().forEach((el) => { | ||
width += $(el).outerWidth() + FUDGE_FACTOR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have this problem anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with flexbox approach to the fixed-table header
|
||
const width = this._calculateWidth(`${headerMiddleSelector} ${cellRowSelector} .frost-table-cell`) | ||
const cssWidth = `${width}px` | ||
this.$(`${headerMiddleSelector} .frost-table-header`).css({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication of the object created from 331 to 334 and 335 to 338
@@ -412,6 +398,30 @@ export default Component.extend({ | |||
}) | |||
}, | |||
|
|||
alignColumns (headerSelecter, bodySelector) { | |||
const cellRowSelector = this.$(`${headerSelecter} .frost-table-header-columns`).length === 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplication from 326
const width = bodyCellWidth > headerCellWidth ? bodyCellWidth : headerCellWidth | ||
|
||
const cssWidth = `${width}px` | ||
curHeaderCell.css({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment (same object created twice)
columns.forEach((column) => { | ||
if (column.category) { | ||
hasCategories = true | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not stop the loop.
let position = index + (selectable ? 2 : 1) | ||
this.setCellWidths(position) | ||
}) | ||
didRender () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you changing the hook?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made more sense than scheduling something on the run queue
addon/components/frost-table.js
Outdated
totalWidth += this.setCellWidths(1) | ||
} | ||
this.columns.forEach((column, index) => { | ||
let position = index + (selectable ? 2 : 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
addon/components/frost-table.js
Outdated
totalWidth += this.setCellWidths(1) | ||
} | ||
this.columns.forEach((column, index) => { | ||
let position = index + (selectable ? 2 : 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 or 1 ? What is 2 and 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as above, account for selection column
{{/if}} | ||
{{#each _categoryColumns as |column|}} | ||
{{frost-table-cell | ||
cellRenderer=column.renderer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not using the headerRenderer
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are, check out the CP
addon/typedefs.js
Outdated
@@ -13,6 +13,9 @@ import {PropTypes} from 'ember-prop-types' | |||
* @property {String} propertyName - the name of the property in the data record to display in this column | |||
* @property {Boolean} [frozen=false] - true if this column should be frozen (on either the left or right side of the table) | |||
* @property {Component} [renderer] - the cell renderer to use for all data cells in this column | |||
* @property {String} [category] - the category the column belongs to | |||
* @property {String} [category] - the css class name of the category the column belongs to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
category twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch :)
Build failing because of linting errors. |
Changes Unknown when pulling a6ec68f on AdamWard1995:columnGrouping into ** on ciena-frost:master**. |
This project uses semver, please check the scope of this pr:
This commit will enable grouping of columns into a "category"
CHANGELOG