These are chat archives for angular/material

Mar 2018
Mar 05 2018 09:21

Hi guys :-) I'm literaly stuck since 2 days on this ... so I want to assign multiple paginator on multiple datatable generated...
For exemple the server send me 4 tables, each one with their pageSize and their pagination...

How can I perform that ?

I can actually generate multiple datatable but not appliying the pagination on each one.

This is how my datatable are generated (mat-paginator is not working):

<mat-table #table [dataSource]="castMatatableDataSource(subcategory.content.rows)">
                        <ng-container *ngFor="let column of subcategory.content.columns" [matColumnDef]="column.prop">
                            <mat-header-cell *matHeaderCellDef>{{}}</mat-header-cell>
                            <mat-cell *matCellDef="let row" [innerHtml] ="row[column.prop]">{{row[column.prop]}}</mat-cell>

                        <mat-header-row *matHeaderRowDef="subcategory.content.props()"></mat-header-row>
                        <mat-row *matRowDef="let row; columns: subcategory.content.props()"></mat-row>
                    <button (click)="show(table)">SHOW</button>
                    <mat-paginator #paginator

thank you in advance

Hadi Mousavi
Mar 05 2018 14:05
Hello everybody,
How to create a datepicker similar to the material datepicker?
I want to create a persian datepicker.
Mar 05 2018 15:15

I'm using angular material datatable

My datasource is simply an array

My problem is when I add new values to the data array , I don't see it immediately on the datatable

import { Component, OnInit } from '@angular/core';
import { MatTableDataSource } from '@angular/material';
import { AjouttextService } from '../ajouttext.service';
import { DataSource } from "@angular/cdk/collections";
import { Observable } from "rxjs/Observable";
import { nomchamp } from '../model';

  selector: 'app-datatable',
  templateUrl: './datatable.component.html',
  styleUrls: ['./datatable.component.css']
export class DatatableComponent implements OnInit {

  constructor(private dataService: AjouttextService) { }
  data: nomchamp[] = [{ id: "33", text: "HAHA" }, { id: "55", text: "bzlblz" }];

  displayedColumns = ['text'];
  dataSource = new MatTableDataSource(;
  //new UserDataSource(this.dataService);

  applyFilter(filterValue: string) {
    filterValue = filterValue.trim(); // Remove whitespace
    filterValue = filterValue.toLowerCase(); // MatTableDataSource defaults to lowercase matches
  ngOnInit() {
  ajoutText(newtext: String) {
    let nouv: nomchamp = { id: "44", text: newtext };;
Mar 05 2018 15:27
@Githamza dans ta fonction, ajoutText rajoute un parametre table: any ou tu donne le #table dans ton .html
ensuite tu appelles la fonction renderRows() dessus
ajoutText(newtext: String, table:any) {
    let nouv: nomchamp = { id: "44", text: newtext };;
Mar 05 2018 15:38
@cdskill Merci je testerai ca ce soir
Mar 05 2018 22:51
@cdskill I have done what you have asked me to do I got this error ERROR TypeError: table.renderRows is not a function