Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ant design table sort string perfectly

sorter: (a, b) => a.first_name.localeCompare(b.first_name);
Comment

table sorting ant design

const columns = [{
  title: 'Name',
  dataIndex: 'name',
  sorter: (a, b, sortOrder) => {
    if (a.name != null && b.name != null) {
      a.name.localeCompare(b.name);
    }
    if (a.name) {
      return sortOrder === 'ascend' ? 1 : -1;
    }
    if (b.name) {
      return sortOrder === 'ascend' ? -1 : 1;
    }
    return 0;
  },
}]
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to use secondary color in material ui useStyle 
Javascript :: nested loops js 
Javascript :: pagination hook react 
Javascript :: javascript check if variable is number 
Javascript :: mat checkbox change event in angular 7 
Javascript :: lexical scoping javascript 
Javascript :: how to find network there is no network react native 
Javascript :: useeffect hook react 
Javascript :: React best way of forcing component to update 
Javascript :: javascript remove object property 
Javascript :: javascript difference between two dates in days 
Javascript :: how to control playback speed in javascript 
Javascript :: mongoose virtuals 
Javascript :: function(a, b){return b - a} 
Javascript :: validate phone number regex 
Javascript :: ionic cordova icon notification 
Javascript :: js populate an empty array of zeros 
Javascript :: js onload 
Javascript :: js input type range get value while sliding 
Javascript :: jquery thousand separator 
Javascript :: how to disable back js 
Javascript :: palindrome rearranging javascript 
Javascript :: remove validators angular 
Javascript :: regex for non empty string 
Javascript :: vaidate youtube url 
Javascript :: React Hook "React.useState" is called in function "placeItem" which is neither a React function component or a custom React Hook function react-hooks/rules-of-hooks 
Javascript :: import file json angular 12 
Javascript :: how to find length of array in javascript without using length method 
Javascript :: nodejs check if string matches regex 
Javascript :: number of repetition in an array javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+8 =