diff --git a/pages/History.qml b/pages/History.qml index a6c216bf..e31473ae 100644 --- a/pages/History.qml +++ b/pages/History.qml @@ -40,6 +40,11 @@ Rectangle { id: root property var model + QtObject { + id: d + property bool initialized: false + } + color: "#F0EEEE" function getSelectedAmount() { @@ -59,10 +64,26 @@ Rectangle { onModelChanged: { if (typeof model !== 'undefined') { - // setup date filter scope according to real transactions - fromDatePicker.currentDate = model.transactionHistory.firstDateTime - toDatePicker.currentDate = model.transactionHistory.lastDateTime + selectedAmount.text = getSelectedAmount() + + if (!d.initialized) { + // setup date filter scope according to real transactions + fromDatePicker.currentDate = model.transactionHistory.firstDateTime + toDatePicker.currentDate = model.transactionHistory.lastDateTime + + /* Default sorting by timestamp desc */ + /* Sort indicator on table header */ + /* index of 'sort by blockheight' column */ + header.activeSortColumn = 2 + /* Sorting model */ + + model.sortRole = TransactionHistoryModel.TransactionBlockHeightRole + model.sort(0, Qt.DescendingOrder); + d.initialized = true + // TODO: public interface for 'Header' item that will cause 'sortRequest' signal + } + } }