cancel
Showing results for 
Search instead for 
Did you mean: 

unable to update details grid on SelectionEvent

Former Member
0 Kudos

What is wrong with this function? It almost seems that when I execute this Param.1 and Param.2 are dropped from this equation and the function tries to only pass Param.3 into the grid. Without Param.1 and 2 containing some data I return no data. When I test the query without 1 and 2, I get no results, but if I put % in both 1 and 2 I get my results. How do I pass multiple Params into this grid?



function UpdateDetails()
{
	var Query = document.FR_ChemicalProcessing_UNGROUPED_Grid.getQueryObject();
	var select1 = FR_ChemicalProcessing_GROUPED_Grid.getGridObject().getSelectedCellValue(1);
	var select2 = FR_ChemicalProcessing_GROUPED_Grid.getGridObject().getSelectedCellValue(2);
	var select3 = FR_ChemicalProcessing_GROUPED_Grid.getGridObject().getSelectedCellValue(3);

	alert(select1);
	alert(select2);
	alert(select3);

	//change the operator grid query filter
	Query.setParam(1,select1);
	Query.setParam(2,select2);
	Query.setParam(3,select3);

document.FR_ChemicalProcessing_UNGROUPED_Grid.updateGrid(true);

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Your code looks correct.

I assume that the alerts show the expected value?

If you enter those values in the Param.1, Param.2, and Param.3 in the Query Template Editor and test the query, does it work?

Former Member
0 Kudos

The alerts show all of the data correctly. I tested the params by typing in one record that I would select and I noticed that when I typed in the date, the data would come up blank. I omitted the date from my function and it works fine now. So I know it has to do with the date column.

Former Member
0 Kudos

You may need to reformat the date from the grid into the format required by the 2nd query template.

- Rick

Former Member
0 Kudos

This is what I am thinking. Thanks!!

Answers (1)

Answers (1)

Former Member
0 Kudos

This function looks right. I don't see why it wouldn't work. What does your page look like? Does the SelectionEvent on Grid1 update Grid2?

What does your query look like? Which mode are you using? What type of query is it? Can you post up a screenshot or the Fixed query SQL if it is one!?

Also to clean up your code a bit and follow a Best Practice approach:


function UpdateDetails() {
	var Query = document.FR_ChemicalProcessing_UNGROUPED_Grid.getQueryObject();
	var GroupedGrid = document.FR_ChemicalProcessing_GROUPED_Grid.getGridObject();

	var select1 = GroupedGrid.getSelectedCellValueByName(COLNAME);
	var select2 = GroupedGrid.getSelectedCellValueByName(COLNAME);
	var select3 = GroupedGrid.getSelectedCellValueByName(COLNAME);

	//use getSelectedCellValueByName("Col1Name") just in case something in the clumn order changes down the road. 
	//this just uses the column name instead of it's order number
 
	alert("Sel1: " + select1 + "   Sel2:" + select2 + "   Sel3:" + select3);
 
	//change the operator grid query filter
	Query.setParam(1,select1);
	Query.setParam(2,select2);
	Query.setParam(3,select3);
	document.FR_ChemicalProcessing_UNGROUPED_Grid.updateGrid(true);
}