3.0 beta 2

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


// 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

// 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

March 21,
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.
March 22,

This topic is archived.

See also:

Back to support forum


Version 2

Looking for AW 2.6 ?
The old site is here.