|
@@ -140,89 +140,89 @@ function generateTable(par,divName,elementId){
|
|
|
}
|
|
|
|
|
|
|
|
|
-function generateRow(parameters, tableId, rowId){
|
|
|
+function generateRow(par, tableId, rowId){
|
|
|
let debug=true;
|
|
|
if (debug)
|
|
|
- print(parameters.config,"generateRow: Start");
|
|
|
- let config=generateQConfig(parameters.masterQuery);
|
|
|
- config.success=function(data){generateTableRow(data, parameters, tableId, rowId)};
|
|
|
+ print(par.config,"generateRow: Start");
|
|
|
+ let config=generateQConfig(par.masterQuery);
|
|
|
+ config.success=function(data){generateTableRow(data, par, tableId, rowId)};
|
|
|
LABKEY.Query.selectRows(config);
|
|
|
if (debug)
|
|
|
- print(parameters.config,"generateRow: End");
|
|
|
+ print(par.config,"generateRow: End");
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
-function generateTableRow(data, parameters, tableId, rowId){
|
|
|
+function generateTableRow(data, par, tableId, rowId){
|
|
|
let debug=true;
|
|
|
if (debug)
|
|
|
- print(parameters.config,"generateTableRow: start");
|
|
|
- let tb=parameters.config.document.getElementById(tableId);
|
|
|
- let row=parameters.vars[rowId];
|
|
|
+ print(par.config,"generateTableRow: start");
|
|
|
+ let tb=par.config.document.getElementById(tableId);
|
|
|
+ let row=par.vars[rowId];
|
|
|
if (debug)
|
|
|
- print(parameters.config,"getField for "+row.masterSelectVarName);
|
|
|
+ print(par.config,"getField for "+row.masterSelectVarName);
|
|
|
|
|
|
- let field=getField(parameters.config,data,row.masterSelectVarName);
|
|
|
+ let field=getField(par.config,data,row.masterSelectVarName);
|
|
|
let trow=tb.insertRow();
|
|
|
- let cell=parameters.config.document.createElement('th');
|
|
|
+ let cell=par.config.document.createElement('th');
|
|
|
trow.appendChild(cell);
|
|
|
- let text = parameters.config.document.createTextNode(field.shortCaption);
|
|
|
+ let text = par.config.document.createTextNode(field.shortCaption);
|
|
|
cell.appendChild(text);
|
|
|
cell=trow.insertCell();
|
|
|
- let input = parameters.config.document.createElement("select");
|
|
|
+ let input = par.config.document.createElement("select");
|
|
|
input.id = row.selectId;
|
|
|
- input.onchange=function(){row.callback(parameters,rowId)};
|
|
|
+ input.onchange=function(){row.callback(par,rowId)};
|
|
|
cell.appendChild(input);
|
|
|
if (debug)
|
|
|
- print(parameters.config,"generateTableRow: end");
|
|
|
+ print(par.config,"generateTableRow: end");
|
|
|
|
|
|
}
|
|
|
|
|
|
-function populateSelectTableEntry(parameters,rowId){
|
|
|
+function populateSelectTableEntry(par,rowId){
|
|
|
|
|
|
let debug=true;
|
|
|
- let row=parameters.vars[rowId];
|
|
|
+ let row=par.vars[rowId];
|
|
|
if (debug)
|
|
|
- print(parameters.config,"populateSelectTableEntry:"+parameters.masterQuery+"/"+row.masterSelectVarName);
|
|
|
+ print(par.config,"populateSelectTableEntry:"+par.masterQuery+"/"+row.masterSelectVarName);
|
|
|
|
|
|
|
|
|
|
|
|
- let config=generateQConfig(parameters.masterQuery);
|
|
|
+ let config=generateQConfig(par.masterQuery);
|
|
|
|
|
|
if ("filter" in row){
|
|
|
//populateSelect on authorizationQuery with authSelectVarName
|
|
|
let filter=row.filter;
|
|
|
if (debug){
|
|
|
- print(parameters.config,"Filter:"+filter.queryName);
|
|
|
- print(parameters.config,"FilterVar "+filter.filterVarName);
|
|
|
+ print(par.config,"Filter:"+filter.queryName);
|
|
|
+ print(par.config,"FilterVar "+filter.filterVarName);
|
|
|
}
|
|
|
config.queryName=filter.queryName;
|
|
|
config.filterArray=[];
|
|
|
for (f in filter.filters){
|
|
|
- if (debug) print(parameters.config,"Adding filter: "+f+" val "+filter.filters[f]);
|
|
|
+ if (debug) print(par.config,"Adding filter: "+f+" val "+filter.filters[f]);
|
|
|
config.filterArray.push(LABKEY.Filter.create(f,filter.filters[f]));
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
- config.queryName=parameters.masterQuery;
|
|
|
+ config.queryName=par.masterQuery;
|
|
|
}
|
|
|
|
|
|
- config.success=function(data){populateTableRow(data,parameters,rowId)};
|
|
|
+ config.success=function(data){populateTableRow(data,par,rowId)};
|
|
|
LABKEY.Query.selectRows(config);
|
|
|
if (debug)
|
|
|
- print(parameters.config,"generateSelect: End");
|
|
|
+ print(par.config,"generateSelect: End");
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
-function populateTableRow(data,parameters,rowId){
|
|
|
+function populateTableRow(data,par,rowId){
|
|
|
//data is output of selectRows on either
|
|
|
// * masterQuery looking at masterSelectVarName or
|
|
|
// * authQuery looking at authSelectVarName
|
|
|
|
|
|
- //in both cases, query[varName] is a lookup variable, so do populateSelect with lookupData,queryData and parameters
|
|
|
+ //in both cases, query[varName] is a lookup variable, so do populateSelect with lookupData,queryData and par
|
|
|
let debug=true;
|
|
|
- let row=parameters.vars[rowId];
|
|
|
+ let row=par.vars[rowId];
|
|
|
let varName=row.masterSelectVarName;
|
|
|
if ("filter" in row){
|
|
|
if (row.filter.queryName==data.queryName){
|
|
@@ -231,35 +231,35 @@ function populateTableRow(data,parameters,rowId){
|
|
|
}
|
|
|
|
|
|
if (debug)
|
|
|
- print(parameters.config,"generateSelectVar: "+data.queryName+"/"+varName+" size "+data.rows.length);
|
|
|
+ print(par.config,"generateSelectVar: "+data.queryName+"/"+varName+" size "+data.rows.length);
|
|
|
|
|
|
let field=getField(data,varName);
|
|
|
|
|
|
if (!field) {
|
|
|
- print("Field "+varName+" not found");
|
|
|
+ print(par.config,"Field "+varName+" not found");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!("lookup" in field)){
|
|
|
let entry=data.rows[0];
|
|
|
- print("Field "+varName+" not a lookup");
|
|
|
- //populateSelectNotLookup(data,parameters,rowId, entry);
|
|
|
+ print(par.config,"Field "+varName+" not a lookup");
|
|
|
+ //populateSelectNotLookup(data,par,rowId, entry);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
let config=generateQConfig(field.lookup.queryName);
|
|
|
config.schemaName=field.lookup.schemaName;
|
|
|
- //config.success=function(lookupData){populateSelect(lookupData,data,parameters,rowId)};
|
|
|
+ //config.success=function(lookupData){populateSelect(lookupData,data,par,rowId)};
|
|
|
config.success=function(data){selectRowsSuccess(par.config,data)};
|
|
|
LABKEY.Query.selectRows(config);
|
|
|
|
|
|
if (debug)
|
|
|
- print(parameters.config,"generateSelectVar: End");
|
|
|
+ print(par.config,"generateSelectVar: End");
|
|
|
|
|
|
}
|
|
|
|
|
|
//populateSelect, populateSelectNotLookup
|
|
|
|
|
|
-function generateListAndPopulateDaughterSelect(parameters,rowId){;}
|
|
|
-function generateList(parameters,rowId){;}
|
|
|
+function generateListAndPopulateDaughterSelect(par,rowId){;}
|
|
|
+function generateList(par,rowId){;}
|
|
|
|