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);
function confirmDelete(elem,link)
{
if(confirm('Are you sure you want to delete '+elem+' ?'))
{
window.location.href=link;
}
}
// assign external 'data model'
obj.setCellModel(table);
obj.setCellTemplate(new AW.Templates.Link, 6);
obj.setCellTemplate(new AW.Templates.ImageText);
obj.setCellImage("deleteImage", 7);
obj.setCellLink(function(c, r){ return "javascript: confirmDelete('"+this.getCellText(3,r)+' '+this.getCellText(2,r)+"','user.php?function=delete&userId="+this.getCellText(0,r)+"')"; }, 7);
obj.setCellTemplate(new AW.Templates.Link, 7); // and template
This topic is archived.