diff --git a/static/js/gridView.js b/static/js/gridView.js index 03cbe33..4611aa7 100644 --- a/static/js/gridView.js +++ b/static/js/gridView.js @@ -62,7 +62,7 @@ oml.ui.gridView = function() { ], selected: ui.listSelection, size: 128, - sort: ui.listSort, + sort: Ox.clone(ui.listSort, true), unique: 'id' }) .bindEvent({ @@ -79,4 +79,4 @@ oml.ui.gridView = function() { return that; -}; \ No newline at end of file +}; diff --git a/static/js/list.js b/static/js/list.js index 2f5a805..ba7d44e 100644 --- a/static/js/list.js +++ b/static/js/list.js @@ -113,10 +113,15 @@ oml.ui.list = function() { }, oml_find: function() { if (ui.listView == oml.UI.getPrevious().listView) { - if (ui.listSort == oml.UI.getPrevious().listSort) { + if (JSON.stringify(ui.listSort) == JSON.stringify(oml.UI.getPrevious().listSort)) { that.reloadList(); } else { - that.options({sort: ui.listSort}); + //fixme: this reloads list twice. + //just setting sort will not update number of items + that.options({ + sort: Ox.clone(ui.listSort, true) + }); + that.reloadList(); } } },