avoid .sort if value did not change
This commit is contained in:
parent
fde3b905f9
commit
9f5af680ed
1 changed files with 7 additions and 2 deletions
|
@ -1238,6 +1238,7 @@ Ox.TableList = function(options, self) {
|
||||||
} else {
|
} else {
|
||||||
that.$body.value(id, Ox.makeObject(args));
|
that.$body.value(id, Ox.makeObject(args));
|
||||||
Ox.forEach(Ox.makeObject(args), function(value, key) {
|
Ox.forEach(Ox.makeObject(args), function(value, key) {
|
||||||
|
var changed = false;
|
||||||
if (key == self.options.unique) {
|
if (key == self.options.unique) {
|
||||||
// unique id has changed
|
// unique id has changed
|
||||||
self.options.selected = self.options.selected.map(function(id_) {
|
self.options.selected = self.options.selected.map(function(id_) {
|
||||||
|
@ -1247,9 +1248,13 @@ Ox.TableList = function(options, self) {
|
||||||
}
|
}
|
||||||
$cell = getCell(id, key);
|
$cell = getCell(id, key);
|
||||||
if ($cell && !$cell.is('.OxEdit')) {
|
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 key has changed
|
||||||
sort = true;
|
sort = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue