Skip to content
Snippets Groups Projects
Commit 439980b0 authored by parkera's avatar parkera
Browse files

SSDM-3024 : Search call for samples (ongoing work)

SVN: 35884
parent 9b787649
No related branches found
No related tags found
No related merge requests found
...@@ -342,8 +342,9 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { ...@@ -342,8 +342,9 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
}]; }];
//Add properties as columns dynamically depending on the results //Add properties as columns dynamically depending on the results
var foundPropertyCodes = {};
//1. Get properties with actual data
var foundPropertyCodes = {};
for(var rIdx = 0; rIdx < results.objects.length; rIdx++) { for(var rIdx = 0; rIdx < results.objects.length; rIdx++) {
var entity = results.objects[rIdx]; var entity = results.objects[rIdx];
for(var propertyCode in entity.properties) { for(var propertyCode in entity.properties) {
...@@ -353,14 +354,22 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) { ...@@ -353,14 +354,22 @@ function AdvancedSearchView(advancedSearchController, advancedSearchModel) {
} }
} }
//2. Get columns
var propertyColumnsToSort = [];
for(var propertyCode in foundPropertyCodes) { for(var propertyCode in foundPropertyCodes) {
columns.push({ propertyColumnsToSort.push({
label : profile.getPropertyType(propertyCode).label, label : profile.getPropertyType(propertyCode).label,
property : propertyCode, property : propertyCode,
sortable : true sortable : true
}); });
} }
//
//3. Sort column properties by label
propertyColumnsToSort.sort(function(propertyA, propertyB) {
return propertyA.label.localeCompare(propertyB.label);
});
columns = columns.concat(propertyColumnsToSort);
var getDataRows = function(callback) { var getDataRows = function(callback) {
var rows = []; var rows = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment