Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Commit

Permalink
- apply sorting to updated data #1589
Browse files Browse the repository at this point in the history
  • Loading branch information
siemiatj committed Aug 22, 2018
1 parent 1f7f377 commit 75f1bd2
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/containers/MasterWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,21 @@ class MasterWindow extends Component {
return;
}

const orderBy = tabLayout.orderBy;
let sortingOrder = null;

if (orderBy && orderBy.length) {
const ordering = orderBy[0];
sortingOrder =
(ordering.ascending ? '+' : '-') + ordering.fieldName;
}

if (includedTabsInfo[tabId]) {
getTab(tabId, params.windowType, master.docId).then(tab => {
dispatch(addRowData({ [tabId]: tab }, 'master'));
});
getTab(tabId, params.windowType, master.docId, sortingOrder).then(
tab => {
dispatch(addRowData({ [tabId]: tab }, 'master'));
}
);
}
});
}
Expand Down

0 comments on commit 75f1bd2

Please sign in to comment.