3.0 beta 2

Combo inside the grid is not populating the value

I have given my code below. Whenever I click on the combo box and select a value, it is not reflecting back to the cell. I am using IE 6.0.

Can anyone please help me?


var url= "sampleAjaxAction.do";
var async = false;
var obj = new AW.HTTP.Request;
obj.setURL(url);
obj.setRequestMethod("GET");
var xml;
var xmlData;
var data = new Array();
obj.response =
function()
{
xml = obj.getResponseXML();
}
obj.setAsync(async);
obj.request();

xmlData = xml.getElementsByTagName("data");
for(var i=0; i<xmlData.length; i++)
{
var j=0;
data[i] = new Array();
data[i][j++] = xmlData[i].getElementsByTagName("seq")[0].childNodes[0].nodeValue;
data[i][j++]= xmlData[i].getElementsByTagName("andor")[0].childNodes[0].nodeValue;
data[i][j++] = xmlData[i].getElementsByTagName("key")[0].childNodes[0].nodeValue;
data[i][j++] = xmlData[i].getElementsByTagName("operand")[0].childNodes[0].nodeValue;
data[i][j++] = xmlData[i].getElementsByTagName("keyvalue")[0].childNodes[0].nodeValue;
}
var data1 = [
[data[0][0], data[0][1], data[0][2], data[0][3], data[0][4]],
[data[1][0], data[1][1], data[1][2], data[1][3], data[1][4]],
[data[2][0], data[2][1], data[2][2], data[2][3], data[2][4]],
[data[3][0], data[3][1], data[3][2], data[3][3], data[3][4]],
[data[4][0], data[4][1], data[4][2], data[4][3], data[4][4]]
];


var headers = ["Sequence", "And/Or", "Key", "Operand", "Key Value"];

var popUpSelections_1 = ["AND","OR"];



var obj = new AW.UI.Grid;
// var obj = new AW.Grid.Extended;

obj.setSize(600, 150);
obj.setCellText(data1);
obj.setHeaderText(headers);

obj.setColumnCount(5);
obj.setRowCount(5);

obj.setCellEditable(true);

obj.setCellTemplate(new AW.Templates.Combo, 1);

obj.setPopupTemplate(function(col, row){

var grid = this;
var list = new AW.UI.List;

list.setItemText(["AND", "OR", "NOT"]);
list.setItemCount(3);

list.onItemClicked = function(event, i){
var text = this.getItemText(i);
grid.setCellText(text, col, row);
grid.setCellValue(text, col, row);
grid.getCellTemplate(col, row).hidePopup();
}

return list;
});


obj.getPopupTemplate().setStyle("width", "100px");
obj.getPopupTemplate().setStyle("height","50px");
document.write(obj);


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);
}

obj.onCellValidated = function(text, column, row)
{
obj.setCellData(text,column,row);
obj.setCellText(text,column,row);
var r = new AW.HTTP.Request;
r.setURL("sampleAjaxAction.do?requestType=update");
r.setRequestMethod("POST");
r.setParameter("column", column);
r.setParameter("row", row);
r.setParameter("text", text);
r.setAsync(false);
r.response =
function()
{
alert("response recieved");
}
r.request();
Bobby Sands
August 2,

This topic is archived.

See also:


Back to support forum

Search

Version 2

Looking for AW 2.6 ?
The old site is here.