Hyperlinks to a new window
I am new to Javascript and writing my first personal web page, using XML to provide the data model for the grid. One of the columns contains hyperlinks to other sites and I want the user to be able to click on the link and open that URL in a new window. I've tried adding the link template as described in some other messages, and I see the text in hyperlink form on the grid. When I click on the link, I get a new window, but it is the about:blank window and not the correct URL.
I think that I may need to set the link item property, however, I haven't had any luck trying to add lines to do this. If this is what is missing, a specific code example would be helpful.
Here's my code:
var xml = new Active.XML.Table;
xml.setURL("data/" + getSelectedName() + "_wish_lists.xml");
xml.setRows("//gift");
xml.request();
// define column labels
var columns = ["Gift description", "Priority", "Location", "Price"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
obj.setProperty("column/count", 4);
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(xml);
// Convert the text in column 3 to hyperlinks.
var link = new Active.Templates.Link;
link.setAttribute("target", "_new");
obj.setColumnTemplate(link, 2);
// write grid html to the page
document.write(obj);
I think that I may need to set the link item property, however, I haven't had any luck trying to add lines to do this. If this is what is missing, a specific code example would be helpful.
Here's my code:
var xml = new Active.XML.Table;
xml.setURL("data/" + getSelectedName() + "_wish_lists.xml");
xml.setRows("//gift");
xml.request();
// define column labels
var columns = ["Gift description", "Priority", "Location", "Price"];
// create ActiveWidgets Grid javascript object
var obj = new Active.Controls.Grid;
obj.setProperty("column/count", 4);
// provide column labels
obj.setColumnProperty("texts", columns);
// provide external model as a grid data source
obj.setDataModel(xml);
// Convert the text in column 3 to hyperlinks.
var link = new Active.Templates.Link;
link.setAttribute("target", "_new");
obj.setColumnTemplate(link, 2);
// write grid html to the page
document.write(obj);
Lori
October 4,