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'))
};
this.handleRequestSort('', this.props.orderBy);
}
handleRequestSort = (event, property) => {

View File

@ -244,7 +244,7 @@ class AmbassadorsPage extends Component {
addLocationSearchText(cities){
let searchText = '';
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;
@ -394,7 +394,7 @@ class AmbassadorsPage extends Component {
<EnhancedTable
columnData={columnData}
data={data}
orderBy="location"
orderBy="Location"
showSearchColumns={false}
rowsPerPage={10}
isAdmin={false}