3.2.0

New pop up window link in a function

Another simple problem that i'm sure has an easy answer....
how do i set each link to open in a new window. the forums all talk about doing this with something similar to:
var link = new Active.Templates.Link;
link.setAttribute("target", "_new");

But for some reason I can't make it implement when using a "function" rather than the above code? Every time I try to paste the above code into my example below it breaks.

Basically all i need is to open a link in a new window for each of the following columns...sorry again for the lack of programming knowledge...
//	COLUMN 14 LINK
    var myLinks = function(column, row){ 
    	return "http://maps.google.com"; 
    } 

    obj.setCellLink(myLinks, 14); 
    obj.setCellTemplate(new AW.Templates.Link, 14);

        //      COLUMN 15 LINK
    var myLinks = function(column, row){ 
    	return "http://www.google.com";
    } 

    obj.setCellLink(myLinks, 15); 
    obj.setCellTemplate(new AW.Templates.Link, 15); 


    // 	COLUMN 16 LINK
    var myLinks = function(column, row){ 
    	return "https://www.google.com"; 
    } 

    obj.setCellLink(myLinks, 16); 
    obj.setCellTemplate(new AW.Templates.Link, 16);

thank you in advance!!!

linkcrazy max
March 11,
nevermind....

i added this to the end and it works fine.

obj.setAttribute("target", "_new");

so...

//     COLUMN 16 LINK
    var myLinks = function(column, row){ 
        return "https://www.google.com"; 
    } 

    obj.setCellLink(myLinks, 16); 
    obj.setCellTemplate(new AW.Templates.Link, 16); 
    obj.setAttribute("target", "_new");
linkcrazy max
March 12,
actually, it's not working. i tested it offline and it works great then in ie and ff and no deal. now what? any other ideas out there?
am i missing some code?

obj.setAttribute("target", "_new");
linkcrazy
March 12,
You should add 'target' attribute to the link template, not to the grid -

http://www.activewidgets.com/javascript.forum.22203.1/new-popup-window-using-a.html
Alex (ActiveWidgets)
March 13,

This topic is archived.

See also:


Back to support forum