|
|
@@ -58,21 +58,19 @@ function initializeDataTable() {
|
|
|
json.dropdowndata[index].forEach(function (option) {
|
|
|
var selected = false;
|
|
|
if(json.searchterms && json.searchterms[index]){
|
|
|
- console.log('search terms '+index);
|
|
|
- console.log(option);
|
|
|
- if((json.searchterms[index][index]) && (option === json.searchterms[index][index]))
|
|
|
- {
|
|
|
- console.log("selected");
|
|
|
- selected = true;
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- dropdown.append($('<option>',{
|
|
|
- value: option,
|
|
|
- text: option
|
|
|
- }).prop('selected', selected))});
|
|
|
- }});
|
|
|
+ Object.keys(searchTerms[index]).forEach(function (key){
|
|
|
+ var searchValue = searchTerms[index][key]
|
|
|
+ console.log('value: '+searchValue)
|
|
|
+ if(option === searchValue)
|
|
|
+ {
|
|
|
+ selected = true;
|
|
|
+ }})}
|
|
|
+
|
|
|
+ dropdown.append($('<option>',{
|
|
|
+ value: option,
|
|
|
+ text: option
|
|
|
+ }).prop('selected', selected))});
|
|
|
+ }});
|
|
|
|
|
|
|
|
|
return json.data;
|