:: Forum >>

Get the cell value?

how can i get the value of cell?
thanks
Tina
Tuesday, December 6, 2005
gridobj.getCellValue(column,row);
Karl Thoroddsen
Tuesday, December 6, 2005
Thanks for respons.
i`m not java developer, but i just wont to try this great product.
i try this but it doesn`t work.Whot is wrong?
function MyFunction(){
var id = gridobj.getCellValue(0, index);
alert("current selection: " + id);


}

Thanks again
Tina
Tuesday, December 6, 2005
var myData = [
["Titan", "A", "ventures.com"],
["www", "CNAME", "ventures.com"],
["mail", "MX", "ventures.com"],
["ftp", "CNAME", "ventures.com"]
];
var myGrid= new AW.UI.Grid;
myGrid.setColumnCount(3);
myGrid.setRowCount(4);
myGrid.setCellText(myData);
myGrid.setHeaderText(["Name","Type","Zone"]);
document.write(gridDNS);

And then somewhere: myGrid.getCellValue(0,0) which should return "Titan".
Karl Thoroddsen
Tuesday, December 6, 2005
document.write(gridDNS); should of course read:
document.write(myGrid);

Sorry about that.
Karl Thoroddsen
Tuesday, December 6, 2005
Well this is what i need. I wont do delete row with php. I use xml example with "load table" where my php script render data from mysql in XML format. i found the key code for delete someware on the forum.This is the script i don`t now wrer is mistake.


obj.setEvent("onkeydown", readChar);


function readChar(e)
{
var key = e.keyCode;
//alert(e);
switch(key)
{
case 46:

answer = confirm("Are you sure to delete?");
if (answer)
{
//here i wont to retreve row id from "0 column"
var index = obj.getSelectionProperty("index");
var id = gridobj.getCellValue(0, index)

//and after that something like that:
table.setURL("myXML_PhP.php?delete=true&id="+id);
}

break;
case 13:
answer = confirm("Are you sure to insert?");
if (answer)
{
addRow(obj);
}
break;
}
}


The problem is that i don`t now how to retreve the id for selected row on kaydown event.
sory about my english
Thanks Karl for every response.
Tina
Tuesday, December 6, 2005
sory , forget abot part of "insert" kay
Tina
Tuesday, December 6, 2005
I think the best way forward is to check out the examples folder that came with the AW installation.

The add delete row.htm should be very helpful.

Cheers
Karl
Karl Thoroddsen
Tuesday, December 6, 2005

This topic is archived.


Back to support forum

Forum search