From 9f5af680edf98bca4f8ae0e2671f83646757a0f6 Mon Sep 17 00:00:00 2001 From: j Date: Tue, 20 Sep 2016 01:15:21 +0200 Subject: [PATCH] avoid .sort if value did not change --- source/UI/js/List/TableList.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/UI/js/List/TableList.js b/source/UI/js/List/TableList.js index 9df9fdca..3ac3b04b 100644 --- a/source/UI/js/List/TableList.js +++ b/source/UI/js/List/TableList.js @@ -1238,6 +1238,7 @@ Ox.TableList = function(options, self) { } else { that.$body.value(id, Ox.makeObject(args)); Ox.forEach(Ox.makeObject(args), function(value, key) { + var changed = false; if (key == self.options.unique) { // unique id has changed self.options.selected = self.options.selected.map(function(id_) { @@ -1247,9 +1248,13 @@ Ox.TableList = function(options, self) { } $cell = getCell(id, key); if ($cell && !$cell.is('.OxEdit')) { - $cell.html(formatValue(key, value, that.$body.value(id))); + var value = formatValue(key, value, that.$body.value(id)); + if (value != $cell.html()) { + $cell.html(value); + changed = true; + } } - if (!self.options.sortable && key == self.options.sort[0].key) { + if (changed && !self.options.sortable && key == self.options.sort[0].key) { // sort key has changed sort = true; }