:: Forum >> Version 1 >>

Click on a row, and copy the second colum value of this row to the clipboard

Click on a row, and copy the second colum value of this row to the clipboard

For example
1| Test | Test2
2| peter | max

I click in "max" an becomes and I get "peter". If I click "on peter", I becomes "peter" too...
with "obj.setAction("click", function(src){editarticle.catnr.value = src.getDataProperty("text")});" I get the value where the mouse clicked. I will always the value of columm 2.

Tuesday, March 8, 2005
Alex (ActiveWidgets)
Tuesday, March 8, 2005
thx a lot!!!!!!
Wednesday, March 9, 2005
Hi Alex and Steve,
I have tried the example you refer to and it works. I would like however to move the code that shows the value to an external js file. The first step I took is to put in a seperate function
var gridUsers_columns = [
"First Name","Last Name","Department","Country"
gridUsers_data = [
try {
gridUsers = new Active.Controls.Grid;
gridUsers.setColumnText(function(i){return gridUsers_columns[i];});
gridUsers.setDataText(function(i,j){return gridUsers_data[i][j];});
setForm(src) {
rowIndex src.getRowProperty("text");
tekst this.getDataProperty("text"rowIndex1);
catch(error) {
//show error in another frame
parent.bottombar.write("Grid error: "error.description);
This also works fine. When I move this setForm function to a js file however things stop working. I get this error
line 71'gridUsers_data[...]' is null or not an object
I have tried to change the way I attach the function to the grid object by replacing
in the above code by
var row = new Active.Templates.Row;
row.setEvent('onclick', function(){this.action("setFormAction")});
because I saw some people using this technique (although I don't understand what the difference is between both). I keep getting the same error however.
The grid tool works way to good to be the cause so I must be doing something wrong. Can you tell me what ??
Thanks in advance.
Tuesday, March 15, 2005

This topic is archived.

Back to support forum

Forum search