From 9bf755a10dc22481e6c8007619afa420f5894f29 Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 2 Apr 2012 23:07:50 +0200 Subject: [PATCH] TextList: allow for not passing sort by making the unique key, and its operator, the default --- source/Ox.UI/js/List/Ox.TextList.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/Ox.UI/js/List/Ox.TextList.js b/source/Ox.UI/js/List/Ox.TextList.js index 22da6f62..8d457212 100644 --- a/source/Ox.UI/js/List/Ox.TextList.js +++ b/source/Ox.UI/js/List/Ox.TextList.js @@ -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, { columnPositions: [], defaultColumnWidths: self.options.columns.map(function(column) {