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

Pinned rows navigation - draft #591

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

gwhrus
Copy link
Contributor

@gwhrus gwhrus commented Apr 8, 2022

this is a draft for new functionalty - navigation for top-bottom pinned rows

}
return f(...args);
},
type: entry.name
Copy link
Contributor Author

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');
Copy link
Contributor

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;
Copy link
Collaborator

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;
Copy link
Collaborator

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

Copy link
Collaborator

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"
Copy link
Collaborator

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']">
Copy link
Collaborator

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);
Copy link
Collaborator

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)) {
Copy link
Collaborator

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)) ||
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix formatting, add offset

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

Successfully merging this pull request may close these issues.

3 participants