:: Forum >>

question on setpopuptemplate

I am using the combo object in the header (second row of header) as well in cells of the grid. the setpopuptemplate method only contains column and row parameters, so the popup for the header shows row as 1 and the second row of the grid also shows row = 1. The question is how do I distinguish between the header and the second row of the grid?
Monday, February 12, 2007
I figured out a work around for this. Its not pretty but it works. The problem is that I am using a dropdown in the second header row to do filtering and a dropdown in certain cells to do updates of data.

The setpopuptemplate() method only accepts row. So row can equal 1 and you wouldn't know if the source was the header or the cell row 1.

The work around is that when the header is clicked, the following fire:

so, in headermousedown I set a variable:

headerClicked = true

In setpopuptemplate I check to see if headerClicked == true. Now I know the source.

In the headerClicked event, I turn the variable back to false.
Tuesday, February 13, 2007
You can also define more popup templates and map the specific one to the combo in the header -

var list1 = new AW.UI.List;



var combo1 = new AW.Templates.Combo;
combo1.mapTemplate("popup", "headerPopup");

obj.setHeaderTemplate(combo1, 1, 1);

The call to mapTemplate('from', 'to') redirects template calls from the 'popup' template to 'headerPopup' template. This way you can assign different popup templates to the header, footer and the grid cells.
Alex (ActiveWidgets)
Tuesday, February 13, 2007

Thanks, that is a much better solution than mine!
I'll try it out.
Tuesday, February 13, 2007

This topic is archived.

Back to support forum

Forum search