3.2.0

creating hyperlinks

this code will create hyperlinks from the second column:
var link = new Active.Templates.Link;
link.setAttribute("href", function() {
return this.getItemProperty("value");
});

obj.setColumnTemplate(link, 1);

Now, i would like to create hyperlinks in another column, using the text from the second column.
I know how to retrieve a value from the second column by selection:

function mySelect(){
var index = this.getSelectionProperty("index");
var text = this.getDataProperty("text", index, 1);
alert(text);
}

obj.setAction("selectionChanged", mySelect);

However, I did not succeed in combining these, so that hyperlinks are created in a column, based on values of another. Is that possible?
btw, I use plain text, not XML
Heeko
March 6,
I found the solution by mistake...
This code creates hyperlinks in the 2nd column based on the third column.

// hyperlinks
var link = new Active.Templates.Link;
link.setAttribute("href", function() {
var text = this.getDataProperty("value",2);
return text;
});

obj.setColumnTemplate(link, 1);

Maybe someone could explain this to me?
Again, it seems a lot different from getting a value from the third column by selection:

var index = this.getSelectionProperty("index");
var text = this.getDataProperty("value", index, 2);
alert(text);
Heeko
March 7,

This topic is archived.

See also:


Back to support forum