TextList: allow for not passing sort by making the unique key, and its operator, the default

This commit is contained in:
rolux 2012-04-02 23:07:50 +02:00
parent b9ebb11d48
commit 9bf755a10d

View file

@ -108,6 +108,13 @@ Ox.TextList = function(options, self) {
} }
}); });
if (Ox.isEmpty(self.options.sort)) {
self.options.sort = [{
key: self.unique,
operator: Ox.getObjectById(self.options.columns, self.unique).operator
}];
}
Ox.extend(self, { Ox.extend(self, {
columnPositions: [], columnPositions: [],
defaultColumnWidths: self.options.columns.map(function(column) { defaultColumnWidths: self.options.columns.map(function(column) {