3.2.0

multiple inputs in same row of grid don't work?

I'm evaluating AW (impressed so far!) for a particular project and I've been adding code to a couple of the examples in the documentation and from tidbits I've found on these boards....

I've identified two problems...could someone take a look and tell me what I've done wrong or if its a bug....?

1st problem: I'm trying to use a data grid with inputs for every column/every row. It displays properly, but when I click into an input and start typing, focus always switches to the lowest-left input.

2nd problem: I've added inputs into the data grid --add/remove rows example. When I try and delete a row, regardless of what row I'm in, aw deletes the newest row?

Any help/suggestions would be greatly appreciated!

<script>
var myHeaders = ["College","Degree","City/State"];
var obj = new AW.UI.Grid;
// var obj = new AW.Grid.Extended;

obj.setSize(360, 100);
obj.setCellText(function(i, j){return j + "-" + i});
obj.setHeaderText(myHeaders);

obj.setColumnCount(3);
obj.setRowCount(1);

var inp1 = new AW.UI.Input;
inp1.setId("input1");
inp1.setControlText("Enter college name");

var inp2 = new AW.UI.Input;
inp2.setId("input2");
inp2.setControlText("Enter degree");

var inp3 = new AW.UI.Input;
inp3.setId("input3");
inp3.setControlText("Enter city/state");

obj.setSize(360, 100);

obj.setCellTemplate(inp1,0,0);
obj.setCellTemplate(inp2,1,0);
obj.setCellTemplate(inp3,2,0);


obj.setCellEditable(true);

document.write(obj);


obj.onRowAdded = function(row){
window.status = "Row added: " + row;
this.setCellTemplate(inp1,0,row);
this.setCellTemplate(inp2,1,row);
this.setCellTemplate(inp3,2,row);
}

obj.onRowDeleting = function(row){
return !confirm("Delete row " + row + "?");
}

obj.onRowDeleted = function(row){
window.status = "Row deleted: " + row;
}


// row index
var serial = 1000;

function add(){
obj.addRow(serial++);
}

function del(){
var i = obj.getCurrentRow();
obj.deleteRow(i);
}

</script>

Nathan
March 9,

This topic is archived.

See also:


Back to support forum