3.2.0

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?
Joel
February 12,
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:
headermousedown
headermouseup
setpopuptemplate()
headerclicked

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.
Joel
February 13,
You can also define more popup templates and map the specific one to the combo in the header -

var list1 = new AW.UI.List;
...

obj.defineTemplate("headerPopup");

obj.setHeaderPopupTemplate(list1);

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)
February 13,
Alex,

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

This topic is archived.

See also:


Back to support forum