angular-material

Iterate through dataSource in mat-table Angular

喜欢而已 提交于 2021-02-10 12:33:05
问题 I have problem with iterations through dataSource, where I have data for mat-table <div *ngFor="let element of arrayMain" id = "{{element}}" class="my_item"> <div><span class="skuska"><span class="mat-subheading-2">{{element}}</span></span></div> <mat-table #table [dataSource]="dataSource[1]" matSort> <ng-container matColumnDef="{{column.id}}" *ngFor="let column of columnNames"> <mat-header-cell *matHeaderCellDef mat-sort-header > {{column.value}} </mat-header-cell> <mat-cell *matCellDef="let

Iterate through dataSource in mat-table Angular

白昼怎懂夜的黑 提交于 2021-02-10 12:32:29
问题 I have problem with iterations through dataSource, where I have data for mat-table <div *ngFor="let element of arrayMain" id = "{{element}}" class="my_item"> <div><span class="skuska"><span class="mat-subheading-2">{{element}}</span></span></div> <mat-table #table [dataSource]="dataSource[1]" matSort> <ng-container matColumnDef="{{column.id}}" *ngFor="let column of columnNames"> <mat-header-cell *matHeaderCellDef mat-sort-header > {{column.value}} </mat-header-cell> <mat-cell *matCellDef="let

angular material md-datepicker not working in an ionic modal

好久不见. 提交于 2021-02-10 12:03:37
问题 I am attempting to use an angular material md-datepicker within an ionic modal and am not having the ng-change event being fired when the datepicker is used and date is changed,the datepicker itself won't scroll, and doesn't seem clickable. When I have tried using the datepicker outside of the modal, all works correctly. What is going on here? <script id="add-location-modal.html" type="text/ng-template"> <ion-modal-view> <ion-content> <md-content layout-padding> <form name="myForm" style="">

MatDialog not showing

和自甴很熟 提交于 2021-02-10 11:55:44
问题 I want to add a dialog to my application, but for some reason it is not showing. The dialog component: import { Component, OnInit } from '@angular/core'; import {MatDialogRef} from "@angular/material"; @Component({ selector: 'app-connect-to-player-dialog', templateUrl: './connect-to-player-dialog.component.html', styleUrls: ['./connect-to-player-dialog.component.css'] }) export class ConnectToPlayerDialogComponent implements OnInit { constructor() { } ngOnInit() { } } The method used:

MatDialog not showing

浪尽此生 提交于 2021-02-10 11:51:06
问题 I want to add a dialog to my application, but for some reason it is not showing. The dialog component: import { Component, OnInit } from '@angular/core'; import {MatDialogRef} from "@angular/material"; @Component({ selector: 'app-connect-to-player-dialog', templateUrl: './connect-to-player-dialog.component.html', styleUrls: ['./connect-to-player-dialog.component.css'] }) export class ConnectToPlayerDialogComponent implements OnInit { constructor() { } ngOnInit() { } } The method used:

Cannot set Angular Material matColumnDef property

主宰稳场 提交于 2021-02-08 11:52:38
问题 I have a datatable and want to change the value for matColumnDef property. However, I cannot change it when using it with [matColumnDef] as shown below: <ng-container *ngIf="hasButton" [matColumnDef]="action"> On th other hand, when change its value without bracket matColumnDef , the related part is not rendered on the page. So, what is the difference between [matColumnDef] and matColumnDef ? And why I cannot set it by free value? <ng-container *ngIf="hasButton" matColumnDef="action"> 回答1: I

Angular Material Table: custom sort foler and file items

梦想的初衷 提交于 2021-02-08 10:12:27
问题 I have different types of items in my mat-table : Files and Folders. They have to get sorted like in Microsofts file-explorer. Folders can`t be separated from folders and likewise with files. All other sorting rules staying the same. Has anyone an idea how to solve this? Thank you in advance! 回答1: You will have to overwrite the sortData on your MatTableDataSource attached to the table. This is the function that is responsible for sorting records, e.g. this.dataSource.sortData = (data:

Angular Material Table: custom sort foler and file items

China☆狼群 提交于 2021-02-08 10:12:21
问题 I have different types of items in my mat-table : Files and Folders. They have to get sorted like in Microsofts file-explorer. Folders can`t be separated from folders and likewise with files. All other sorting rules staying the same. Has anyone an idea how to solve this? Thank you in advance! 回答1: You will have to overwrite the sortData on your MatTableDataSource attached to the table. This is the function that is responsible for sorting records, e.g. this.dataSource.sortData = (data:

Left sticky columns disappear when scrolling horizontally mat-table with too many columns are present

一曲冷凌霜 提交于 2021-02-08 09:53:42
问题 When scrolling horizontally mat-table, row does not expand to the end of column, just columns that are present on the screen. Because of that, when horizontal scrolling to the right, when mat-row goes out of screen, left sticky columns also leaves (see black border that are present on bottom of mat-row). Url example link: https://stackblitz.com/edit/angular-ddqxvn Is it possible to expand mat-row to all columns (even does that are out of screen), which will keep sticky columns on the left. I

Left sticky columns disappear when scrolling horizontally mat-table with too many columns are present

笑着哭i 提交于 2021-02-08 09:53:41
问题 When scrolling horizontally mat-table, row does not expand to the end of column, just columns that are present on the screen. Because of that, when horizontal scrolling to the right, when mat-row goes out of screen, left sticky columns also leaves (see black border that are present on bottom of mat-row). Url example link: https://stackblitz.com/edit/angular-ddqxvn Is it possible to expand mat-row to all columns (even does that are out of screen), which will keep sticky columns on the left. I