-
Notifications
You must be signed in to change notification settings - Fork 27
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
Pinned rows navigation - draft #591
base: master
Are you sure you want to change the base?
Conversation
packages/qgrid-ngx/src/lib/cell-handler/cell-handler.component.ts
Outdated
Show resolved
Hide resolved
} | ||
return f(...args); | ||
}, | ||
type: entry.name |
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.
Adding this and factory pattern?
addNext('mid','top'); | ||
addNext('right','top'); | ||
addNext('left','mid'); | ||
addNext('mid','mid'); |
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.
['left', 'mid', 'right'].forEach(pin => (['top', 'mid', 'bottom'].forEach(pos => addNext(pin, pos))));
const { table } = this.root; | ||
const { table, model } = this.root; | ||
|
||
this.model = model; |
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 u need to store this.model? u can get it from this.root always
index += this.model.row().pinTop.length; | ||
} | ||
if (this.pin == 'bottom') { | ||
index += this.model.row().pinTop.length + this.model.scene().rows.length; |
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 think model.scene should also contain pinned rows
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.
Also this is an interesting questions if we have page size set to 50 and have 2 pinned rows, overall we should show 50 or 52 rows?
<td *ngFor="let $column of $view.body.render.columns($row, $table.pin, $rowIndex); index as $columnIndex; trackBy: columnId" | ||
[attr.rowspan]="$view.body.render.rowspan($row, $column, $rowIndex, $columnIndex)" | ||
[attr.colspan]="$view.body.render.colspan($row, $column, $rowIndex, $columnIndex)"> | ||
<ng-container [q-grid-core-td]="$column" | ||
<ng-container [q-grid-core-td]="$column" [q-grid-core-pin]="pin" |
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.
you can understand pin from TableService no need to use binding
@@ -3,7 +3,7 @@ | |||
|
|||
<mat-menu #menu="matMenu" | |||
class="q-grid-mat-menu"> | |||
<mat-card *ngIf="trigger.menuOpen"> | |||
<mat-card *ngIf="trigger.menuOpen" [q-grid-stop-propagate]="['keydown', 'keypress', 'keyup']"> |
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.
fix formatting please
*ngIf="..."
[q-grid-stop-propagate]="..."
@@ -344,7 +351,7 @@ export class ViewHost { | |||
const { table } = this.plugin; | |||
const pathFinder = new PathService(table.box.bag.body); | |||
const path = eventPath(e); | |||
return pathFinder.row(path); | |||
return pathFinder.row(path); |
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.
fix formatting
|
||
if (highlight.row.canExecute(index)) { | ||
let correctedIndex = index; | ||
if (highlight.row.canExecute(correctedIndex)) { |
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.
all logic should be encapsulated under the dom table class, users should not be aware of pinned or unpinned options
return this.getElementsCore('body') | ||
.some(element => this.isFocusedCore(element)); | ||
return this.getElementsCore('body').some(element => this.isFocusedCore(element)) || | ||
this.getElementsCore('body-top').some(element => this.isFocusedCore(element)) || |
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.
fix formatting, add offset
this is a draft for new functionalty - navigation for top-bottom pinned rows