Location sort based on Country first and city

mx
Letícia Camara 2018-11-01 14:05:53 -03:00
parent 57a63fa711
commit ba65b67aaa
2 changed files with 4 additions and 2 deletions

View File

@ -81,6 +81,8 @@ class EnhancedTable extends Component {
}; };
}).sort(sortBy('name')) }).sort(sortBy('name'))
}; };
this.handleRequestSort('', this.props.orderBy);
} }
handleRequestSort = (event, property) => { handleRequestSort = (event, property) => {

View File

@ -244,7 +244,7 @@ class AmbassadorsPage extends Component {
addLocationSearchText(cities){ addLocationSearchText(cities){
let searchText = ''; let searchText = '';
cities.forEach((location) => { cities.forEach((location) => {
searchText += `${(location.name).replace(/(^|\s)\S/g, l => l.toUpperCase())} - ${countries.getName(location.country)} `; searchText += `${countries.getName(location.country)} - ${(location.name).replace(/(^|\s)\S/g, l => l.toUpperCase())}`;
}); });
return searchText; return searchText;
@ -394,7 +394,7 @@ class AmbassadorsPage extends Component {
<EnhancedTable <EnhancedTable
columnData={columnData} columnData={columnData}
data={data} data={data}
orderBy="location" orderBy="Location"
showSearchColumns={false} showSearchColumns={false}
rowsPerPage={10} rowsPerPage={10}
isAdmin={false} isAdmin={false}