Which way to set a cell template?
Hi folks
I'm trying to put a Combo (same applies to checkboxes) into a given column in every row of a grid. I figure that both of the following achieve this:
(a) rowCombo = new AW.Templates.Combo;
obj.setCellTemplate(rowCombo, 1);
(b) rowCombo2 = new AW.UI.Combo;
obj.setCellTemplate(rowCombo, 1);
From the quickref/grid.htm example it seems we are guided to use approach (a). Now if I want to populate the Combo, I would use methods setItemText and setItemCount, but these methods only work with rowCombo2 i.e. approach (b).
So which is the way to do it (and why?) If it is (a), then how should you populate the Combo (I've tried to follow the relationship between Combo, List and Popup templates but I do not follow how to use them)?
Also (as with checkboxes), I'm hoping to have a "tag all" Combo in the header row so that this will be able to change all the Combos in the column. On this Combo I would use the event handler:
headerCombo.onControlValueChanged
when using this with a simple alert i.e.
headerCombo.onControlValueChanged = function(value){alert(value); }
you get two alerts when the value selected changes - not sure why this should happen - is this correct?
As ever, any input on these issues much appreciated.
Will
I'm trying to put a Combo (same applies to checkboxes) into a given column in every row of a grid. I figure that both of the following achieve this:
(a) rowCombo = new AW.Templates.Combo;
obj.setCellTemplate(rowCombo, 1);
(b) rowCombo2 = new AW.UI.Combo;
obj.setCellTemplate(rowCombo, 1);
From the quickref/grid.htm example it seems we are guided to use approach (a). Now if I want to populate the Combo, I would use methods setItemText and setItemCount, but these methods only work with rowCombo2 i.e. approach (b).
So which is the way to do it (and why?) If it is (a), then how should you populate the Combo (I've tried to follow the relationship between Combo, List and Popup templates but I do not follow how to use them)?
Also (as with checkboxes), I'm hoping to have a "tag all" Combo in the header row so that this will be able to change all the Combos in the column. On this Combo I would use the event handler:
headerCombo.onControlValueChanged
when using this with a simple alert i.e.
headerCombo.onControlValueChanged = function(value){alert(value); }
you get two alerts when the value selected changes - not sure why this should happen - is this correct?
As ever, any input on these issues much appreciated.
Will
Will
November 15,