3.2.0

recover Grid- Row value

Hi ,
I have this jsp which is used to input some values , which in turn populates a grid ,
Now what i need to do is when i double click on a particular row , i want the data to be poulated back to the my form .
i tried the following code , for puttting up an alert but it does not return a value to jsp .
obj.setAction("click",function(src){
var row = src.getRowProperty("index");
var count = this.getColumnProperty("count");
var column, result = [];
for (column = 0; column < count; column++){
result.push(this.getDataProperty("text", row, column)); }
alert(result);
}
);
I am a new-bee in java/jsp , so could you help,
your help would be appreciated .
Thanks
Shubhankar Sharma
January 16,
Hi, hope this helps you.
I've a record id in column 0, after double click I want the record to be displayed.

<script>
function myDoubleClick(src) {
var rows = src.getRowProperty("values");
var index=src.getProperty("item/index");
alert(src.getDataProperty("text", 0,rows[index] ));
}

// create ActiveWidgets data model - text-based table
var table = new Active.Text.Table;

// provide data URL - plain text comma-separated file
table.setURL("createcsv.cgi");

// start asyncronous data retrieval
table.request();
// define column labels
var columns = ["Ticker", "Company Name", "Market Cap.", "$ Sales", "Employees"];
// create ActiveWidgets Grid javascript object
var grid_obj = new Active.Controls.Grid;
// provide column labels
grid_obj.setColumnProperty("texts", columns);

// provide external model as a grid data source
grid_obj.setDataModel(table);

var row = grid_obj.getTemplate("row");
row.setEvent("ondblclick", function(){this.action("myAction")});
grid_obj.setTemplate("row", row);
grid_obj.setAction("myAction", myDoubleClick);
<script>
matthieu
November 11,

This topic is archived.

See also:


Back to support forum