Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

sortingDataAccessor

ViewChild(MatSort) sort: MatSort;

ngOnInit() {
  this.dataSource = new MatTableDataSource(yourData);
  this.dataSource.sortingDataAccessor = (item, property) => {
    switch(property) {
      case 'project.name': return item.project.name;
      default: return item[property];
    }
  };
  this.dataSource.sort = sort;
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: url fetch app pass payload and headers 
Javascript :: javascript get name from steamid 
Javascript :: require cycle disable warning react native 
Javascript :: typeracer 
Javascript :: angular 8 remove cookies 
Javascript :: gojs select node programmatically 
Javascript :: hash url owl carousel example 
Javascript :: can i select multiple classes and give function to them at once but different in js 
Javascript :: node js error 
Javascript :: how to connect socket in react js 
Javascript :: How to use `setState` callback on react hooks 
Javascript :: reverseString / Palindrome / Split string / Reverse Array 
Javascript :: javascript sig figs 
Javascript :: loop map with key value pair js 
Javascript :: string contains js 
Javascript :: normal function vs arrow function 
Javascript :: play audio file in phaser 
Javascript :: jqerrt get all img alt from string 
Javascript :: how to give default value in jquery 
Javascript :: javascript this inside function 
Javascript :: redux actions.js 
Javascript :: javascript closest data attribute 
Javascript :: Reactjs cant find serviceWorker.js file in app src folder 
Javascript :: react header 
Javascript :: javascript set elements width by tag name 
Javascript :: js jquery class ending with string 
Javascript :: change color in react 
Javascript :: get time in google apps script 
Javascript :: Setting up an Express project 
Javascript :: make id of certain length js 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =