Location sort based on Country first and city
This commit is contained in:
parent
57a63fa711
commit
ba65b67aaa
2 changed files with 4 additions and 2 deletions
|
@ -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) => {
|
||||||
|
|
|
@ -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}
|
||||||
|
|
Loading…
Reference in a new issue