-
Notifications
You must be signed in to change notification settings - Fork 161
Row pinning base #6848
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
Row pinning base #6848
Conversation
…iable row heights.
<span *ngIf="hasMovableColumns && draggedColumn && pinnedColumns.length <= 0" | ||
[igxColumnMovingDrop]="headerContainer" [attr.droppable]="true" id="left" | ||
class="igx-grid__scroll-on-drag-left"></span> | ||
<span *ngIf="hasMovableColumns && draggedColumn && pinnedColumns.length > 0" | ||
[igxColumnMovingDrop]="headerContainer" [attr.droppable]="true" id="left" | ||
class="igx-grid__scroll-on-drag-pinned" [style.left.px]="pinnedWidth"></span> | ||
<div #pinContainer *ngIf='pinnedRecords.length > 0 && isRowPinningToTop' class='igx-grid__tr--pinned igx-grid__tr--pinned-top'> |
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.
Is it possible to have both the top and bottom pinning use the same template so that there is less code repetition?
@skrustev please re-test. |
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 noImplicitAny
compilation enabled, let's not leave spots for future errors though.
* this.grid.selectedRows[0].pinned = true; | ||
* ``` | ||
*/ | ||
public set pinned(value: boolean) { |
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 sure this is needed, considering row.grid
(and thus its API) is public + you have the shorthand pin methods.
Not a big deal though.
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.
I assume it was added in the specification so that it's the same as the column, although its functionality overlaps with the pin/unpin methods. @ChronosSF let me know if you still think it is necessary.
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.
I was specifically looking at the spec for this, but I can't see anything for the row API additions.
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.
While there's no dedicated section for Row API methods, there is a mention under 3.3. Developer Experience:
"Similar to the column counterparts, the row directive has pin and unpin methods that are used under the hood, as well as pinned getter/setter for maximum flexibility to the user. "
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.
Fair enough, still feels a bit redundant since the column is declarative and the row isn't, but one more shorthand won't hurt much.
@@ -826,7 +826,11 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType, | |||
/** | |||
* @hidden @internal | |||
*/ | |||
public getContext(rowData, rowIndex): any { | |||
public getContext(rowData: any, rowIndex: number, pinned?: boolean): any { | |||
if (pinned && !this.isRowPinningToTop) { |
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.
@MayaKirova @ChronosSF This should definitely be noted in the feature documentation, that pinned rows will affect the start index of normal rows or are affected by the length of the data view when on the bottom.
Related to #6640
Additional information (check all that apply):
Checklist:
feature/README.MD
updates for the feature docsREADME.MD
CHANGELOG.MD
updates for newly added functionalityng update
migrations for the breaking changes