React - sort function

0 votes
212 views
added May 10, 2019 in React by LC Marshal Captain (25,790 points)
sortFieldProject = (filedProject) => {
    const { sortTransaction } = this.context;
    let sortOrder = filedProject;
    sortOrder = (sortOrder === 'asc') ? 'desc' : 'asc'
    sortTransaction('project_name', sortOrder);
    this.setState({
      filedProject: sortOrder,
      filedTenure: 'asc',
      filedPsf: 'asc',
      filedPrice: 'asc',
      fieldTransactionSort: 'asc',
    });
}

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...