:: Forum >> Version 1 >>

how to get data by column's name when click a row?

how to get data by column's name when click a row?

I use the examples/grid/base.html

<script>

// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;

//obj.setProperty("selection/multiple", true);


// set number of rows/columns
obj.setRowProperty("count", <ww:text name="list.size" />);
obj.setColumnProperty("count", 2);

// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setColumnProperty("text", function(i){return myColumns[i]});

// set headers width/height
obj.setRowHeaderWidth("28px");
obj.setColumnHeaderHeight("20px");

// set click action handler
obj.setAction("click", function(src){window.status = src.getItemProperty("text"););

//how to set this action, to get a data by column's on clicked row?

// write grid html to the page
document.write(obj);

</script>
Creatxr
Monday, March 21, 2005
If you want to get the data for all cells in the active column:

There are examples that show how to get the index of the selected row. I currently have no link available, but is it something like
var rowIndex this.getProperty("row/index");
 
Once you have the index you can loop over your data array, assuming you are using an array for your data.

Hope that helps.
Andreas
Tuesday, March 22, 2005



This topic is archived.

Back to support forum

Forum search