3.2.0

How to get single value on click of any cell in the same row

Hi all,

I am struck in between, I would like to know "How to get single value(or last cell value only - say ID) on click of any cell in the same row. Or can we keep something common for complete row. So that anywhere we click on the row, we can get one single value.

Please send the reply to iamini@hotmail.com

Thanks in Advance.
Ameen
Ameenullah
October 17,
obj.setAction("click", function(src){
alert(myData[src.getItemProperty("index")][0])
});
October 17,
Thanks a ton... :)
Ameenullah
October 17,
Hello,
I'm getting an "On page error" when I click on cells. Do I need to do something to the code above to get it to work?
November 19,
Nevermind, I got it!
November 20,
The setAction event above doesn't work for the Grid of version 2, Plz help
Ritesh Jagga
November 23,
for Beta version 2 how to get onblur event in grid
Imran
December 6,
In the above mentioned code
obj.setAction("click", function(src){
alert(myData[src.getItemProperty("index")][0])
});
What is myData.
Adarsh
January 21,
That seems to be the problem, you have to refer back to your original data to get the id value from the selection index. There should be a way to get the actual data so that an entity id can be passed to the server.
Warrell
February 14,
How do I store the information into an object or even send it anyware else, but a message box?
Abe mister
March 9,
Hope this helps... i just practiced today.. sorry if not so good.

<html>
<head>
<title>ActiveWidgets Example</title>
<!-- ActiveWidgets stylesheet and scripts -->
<link href="runtime/styles/classic/grid.css" rel="stylesheet" type="text/css" ></link>
<script src="runtime/lib/grid.js"></script>
<style>
* {-moz-box-sizing: border-box;}
html { width: 100%; height: 100%; margin: 0px; padding: 0px; overflow: hidden}
body { width: 100%; height: 100%; margin: 0px; padding: 50px; overflow: hidden; font: menu}
</style>
<script>
window.focus();
</script>
</head>
<body>
<script>

var myCells = [
["MSFT","Microsoft Corporation", "314,571.156", "32,187.000"],
["ORCL", "Oracle Corporation", "62,615.266", "9,519.000"],
["SAP", "SAP AG (ADR)", "40,986.328", "8,296.420"],
["CA", "Computer Associates Inter", "15,606.335", "3,164.000"],
["ERTS", "Electronic Arts Inc.", "14,490.895", "2,503.727"]
];

var obj = new Active.Controls.Grid;

obj.setDataText(function(i,j){return myCells[i][j]});
obj.setColumnCount(4);
obj.setRowCount(5);


obj.setAction("click", function(src)
{
//the [1] is the column... play with it..
alert(myCells[src.getItemProperty("index")][1])
});

document.write(obj);
</script>

</body>
</html>
Aris
May 17,

This topic is archived.

See also:


Back to support forum