The pop up that I am trying to display when clicking on an <a> tag seems to not be able to take in the URL that I have passed into it via a post-back. All this does is to throw me an error stating. These snippet of code seems to be working on a previous iteration of an application but seems to be continuing to throw this error in this new iteration of the application that I am currently developing.
Uncaught TypeError: Cannot read properties of undefined (reading 'open')
at window.radopen
at OpenForm
at HTMLAnchorElement.onclick
window.radopen
OpenForm
onclick
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Animation="Resize"
OnClientBeforeShow="clientBeforeShow" AutoSize="true" Title="Product Details"
ViewStateMode="Disabled" EnableViewState="false" Behaviors="Close, Move" VisibleOnPageLoad="false"
VisibleStatusbar="false" DestroyOnClose="true" MinWidth="650px" MinHeight="500px">
<Windows>
<telerik:RadWindow ID="ConfirmDialogue" runat="server" Title="Product Details"
AutoSize="true" DestroyOnClose="true" EnableViewState="false" ReloadOnShow="true"
Style="display: none;" ShowContentDuringLoad="false" Modal="true" VisibleStatusbar="false">
</telerik:RadWindow>
</Windows>
</telerik:RadWindowManager>
My javascript:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"><script type="text/javascript">
function OpenForm(arg) {
console.log("Argument: ", arg);
var encodedArg = encodeURIComponent(arg);
window.radopen(encodedArg, "ConfirmDialogue");
}
$(function () {
$("#tabs-min").tabs();
});
function onClientClickPostbackBill() {
__doPostBack('<%=lnkBill.UniqueID%>', '');
}
function onClientClickPostbackStuff() {
__doPostBack('<%=lnkStuff.UniqueID%>', '');
}
function onClientClickPostbackProduct() {
__doPostBack('<%=lnkProduct.UniqueID%>', '');
}
function onClientClickPostbackMerch() {
__doPostBack('<%=lnkMerch.UniqueID%>', '');
}
function onClientClickPostbackUsers() {
__doPostBack('<%=lnkUsers.UniqueID%>', '');
}
function onClientClickPostbackALL() {
__doPostBack('<%=lnkALL.UniqueID%>', '');
}
function onClientClickPostbackREVIEW() {
__doPostBack('<%=lnkREVIEW.UniqueID%>', '');
}
function printPage(productNo) {
var div = document.getElementById("printerDiv");
div.innerHTML = '<iframe id="printframe" src="Letter.aspx?BatchNo=' + batchNo + '" height="0px" width="0px" onload="printIframe();"></iframe>';
}
function print2LAPage(productNo, searchType) {
var div = document.getElementById("printerDiv");
div.innerHTML = '<iframe id="printframe" src="/ProductManagement/PrintProductList.aspx?ProductNo=' + productNo + '&ProductType=' + searchType + '" height="0px" width="0px" onload="printIframe();"></iframe>';
}
function printReview(batchNo, searchType) {
var div = document.getElementById("printerDiv");
div.innerHTML = '<iframe id="printframe" src="/ProductManagement/PrintProductList.aspx?ProductNo=' + productNo + '&ProductType=' + searchType + '" height="0px" width="0px" onload="printIframe();"></iframe>';
}
function printIframe() {
var x = document.getElementById("printframe");
var y = (x.contentWindow || x.contentDocument);
y.focus();
// x.contentWindow.document.execCommand('print', false, null);
var oframe = document.getElementById("printframe");
var odoc = oframe.contentWindow.document;
var strlenght = odoc.documentElement.getElementsByTagName('body')[0].innerText;
if (strlenght.trim() == '') {
var message = "Quantity for this product cannot be found";
alert(message);
}
else {
x.contentWindow.document.execCommand('print', false, null);
}
// y.print();
}
</script>
</telerik:RadCodeBlock>