3.2.0

obj.onCellClicked in DATAGRID

I am using the code in this post:
http://www.activewidgets.com/javascript.forum.6897.15/search-function-auto-complete-in.html

specifically
http://www.telefonica.net/web2/webtress/awsamp/examples/autocomplete.html


to find the information in the data grid, the finding relevant work properly, the problem is how I select a row

the problem is that the method does not work
obj.onCellClicked = function(event, col, row){alert("test")};

simply does not work

any idea?
Salvador
June 11,
That's because "obj.onCellClicked" is an ActiveWidgets version 2.x command, and the mentioned example is a 1.x version, you should use this instead.

var row = obj.getTemplate("row");
row.setEvent("onclick", function(){alert('row clicked')});
C+
June 12,
or also:
obj.getTemplate("row").setEvent("onclick", function(src){alert('clicked row #: ' + src.getProperty("row/index") )});
C+
June 12,
all goes well, I only need to print the value of a cell on the row which gave him click.

For example:
if I click on row 5 I want to print the value of a cell 1

this I print the value of the cell which gave click:
obj.setAction("click", function(src){alert(src.getProperty("item/text"))});

I always print the value in cell 1 of the active row

thanks
Salvador
June 12,
already try this:


obj.setAction("click", function(src){alert(this.getCellText(1, 1))});
obj.setAction("click", function(src){alert(src.getCellText(1, 1))});

var row = obj.getTemplate("row");
obj.setAction("click", function(src){alert(src.getCellText(1, row))});

I need to get the value of the first cell of all rows?
Salvador
June 12,
I did in previous versions as follows:

obj.onCellClicked = function(event, col, row){alert(this.getCellText(0, row)))};

but this version does not work as
Salvador
June 12,
ready, I got it, I leave the code

obj.setAction("click", function(src){window.open('../CLIENTES/DIS_DETALLES.asp?ID_CLIENTE='+myData[src.getItemProperty("index")][0]+'', '_parent', '')});
Salvador
June 12,

This topic is archived.

See also:


Back to support forum