diff --git a/src/main/webapp/scripts/xnat/ui/table.js b/src/main/webapp/scripts/xnat/ui/table.js index e7070fc61557643c5584357477e5384e84afc03c..9bf87dc3acf445153b0d78a44e5dc8a719eafaad 100755 --- a/src/main/webapp/scripts/xnat/ui/table.js +++ b/src/main/webapp/scripts/xnat/ui/table.js @@ -123,6 +123,7 @@ var XNAT = getObject(XNAT); var th = element('th', opts, content); this.last.th = th; this.last.tr.appendChild(th); + this._cols++; // do this here? return this; }; @@ -133,8 +134,8 @@ var XNAT = getObject(XNAT); if (data) { this.last.tr = tr; [].concat(data).forEach(function(item, i){ - if (_this._cols && _this._cols > i) return; - _this.td(item)._cols++; + //if (_this._cols && _this._cols > i) return; + _this.td(item); }); } // only add <tr> elements to <table>, <thead>, <tbody>, and <tfoot> @@ -417,8 +418,14 @@ var XNAT = getObject(XNAT); url: XNAT.url.rootUrl(opts.load||opts.url), dataType: opts.dataType || 'json', success: function(json){ - // handle data returned in ResultSet.Result array - json = (json.ResultSet && json.ResultSet.Result) ? json.ResultSet.Result : json; + // support custom path for returned data + if (opts.path) { + json = lookupObjectValue(json, opts.path); + } + else { + // handle data returned in ResultSet.Result array + json = (json.ResultSet && json.ResultSet.Result) ? json.ResultSet.Result : json; + } createTable(json); } }); diff --git a/src/main/webapp/scripts/xnat/ui/tabs.js b/src/main/webapp/scripts/xnat/ui/tabs.js index 0f6c65a73e6f75fdc7b1b436dffdf9ba48051f46..9ef237c507439e2597fc8ff8acd224fbfd2b0329 100755 --- a/src/main/webapp/scripts/xnat/ui/tabs.js +++ b/src/main/webapp/scripts/xnat/ui/tabs.js @@ -137,7 +137,7 @@ var XNAT = getObject(XNAT || {}); $group = $('#' + groupId + '.tab-group'); } else { - $group = $$(tabs.navTabs).find('ul.tab-group') + $group = $$(tabs.navTabs).find('ul.tab-group').first(); } // add all the flippers @@ -201,6 +201,7 @@ var XNAT = getObject(XNAT || {}); $(navTabs).append(tab.groups(obj.meta.tabGroups)); } else { + tabs.hasGroups = false; $(navTabs).spawn('ul.tab-group'); }