:: Forum >>
Combo box in a grid set up
I have a grid (which is a price list) in which the first colum will be a drop down list and based upon what is selected I will populate the rest of the row. Based upon the item selected I then need to populate the price in the next column. I have been attempting to do this and keep having a couple of issues.
1. Is that when the initial list is loaded it is setting the initial value of the list/combo box value to the next item in the list but I would like all of the list/combo boxes to start with the same initial value unless it is an existing order so how do I make each list start at the same item (in this case blank).
2. Next when an item is selected how do I catch that value so I can populate the price cell. When I am using a fixed list I don't have any issues but when I try and use the combo box I can't figure out how to determine that only the combo has changed not any of the other fields.
Thanks in advance
Robert M
Monday, November 5, 2007
Example -
var itemText = ["item1", "item2", "item3"];
var itemPrice = {
"item1": 123,
"item2": 234,
"item3": 345
}
var popup = new AW.UI.List;
popup.setItemText(itemText);
popup.setItemCount(3);
popup.setSize(200, 300);
var obj = new AW.UI.Grid;
obj.setColumnCount(10);
obj.setRowCount(10);
obj.setCellEditable(true);
obj.setCellEditable(false, 0);
obj.setCellTemplate(new AW.Templates.Combo, 0);
obj.setPopupTemplate(popup);
obj.onCellTextChanged = function(text, col, row){
if (col == 0){
updateRow(text, row);
}
}
function updateRow(item, row){
var price = itemPrice[item];
obj.setCellText(price, 1, row);
}
document.write(obj);
Alex (ActiveWidgets)
Thursday, November 8, 2007
This topic is archived.
Back to support forum
Forum search