In web2py_ajax.html I have the following function:

function details(url) {
detailswindow=window.open(url,'details','toolbar=no,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=792,height=696');
if (window.focus) detailswindow.focus();
return false;
}


... which I call in a view:

<td>
{{=A(row.company.name,_onmouseover="this.style.cursor='pointer';",_onclick="javascript:details('%s')"%URL(r=request,f='details',args=[row.company.id]))}}
</td>


I would like to replace the details function with a more generic one,
I tried:

function openwindow(url,name,width,height) {
name=window.open(url,name,'toolbar=yes,location=yes,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=width,height=height');
if (window.focus) detailswindow.focus();
return false;
}


... and in the view:

<td>
{{=A(row.company.name,_onmouseover="this.style.cursor='pointer';",_onclick="javascript:openwindow('%s','detailswindow',
792,696)"%URL(r=request,f='details',args=[row.company.id]))}}
</td>

... but that doesn't work, the window opens, but doesn't have the
desired size. Is it possible to get this to work? If so, how?


Kind regards,

Annet.

Reply via email to