hyperlink and javascript in a cell
I like the ActiveWidgets. It is a very nice tool and I am investigating whether to buy it or not. Therefore I am analyzing the possibilities of this widget.
A critical decision point is whether I am able to create an image per cell and depending on a javascript confirmation I can go to a url. It is easier to describe using an example:
The widget contains a list of users. In the last column(s) there are a few options, like edit and delete (both with an image). When I click the delete-image, i want javascript confirmation (Are you sure you want to delete this user?) and - if confirmed - an url, like users.php?function=delete&userId=55.
I am able to get the images in the cells that i want, but i am unable to deal with the links/javascript.
I got it working in Firefox, but not in Internet Explorer. Any help?
A critical decision point is whether I am able to create an image per cell and depending on a javascript confirmation I can go to a url. It is easier to describe using an example:
The widget contains a list of users. In the last column(s) there are a few options, like edit and delete (both with an image). When I click the delete-image, i want javascript confirmation (Are you sure you want to delete this user?) and - if confirmed - an url, like users.php?function=delete&userId=55.
I am able to get the images in the cells that i want, but i am unable to deal with the links/javascript.
I got it working in Firefox, but not in Internet Explorer. Any help?
obj.setCellModel(table);
obj.setCellTemplate(new AW.Templates.ImageText);
obj.setCellImage("deleteImage", 7);
obj.setCellLink("javascript:void(7);", 7);
obj.setCellTemplate(new AW.Templates.Link, 7); // and template
obj.onCellClicked = function(event, col, row)
{
if (col==7)
{
if (confirm('Are u sure you want to delete '+ this.getCellText(3, row) + ' '+ this.getCellText(2, row) + ' from the system?'))
{
strLink = "users.php?function=testToDelete&userId="+this.getCellText(0, row);
window.location.href=strLink;
}
}
};
// write grid html to the page
document.write(obj);
Joshua Kroeze
July 11,