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 {
|
||||
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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue