This question is locked. New answers and comments are not allowed.
Hello there,
I'm trying to open an invisible Window through Client-side API, here's my view:
My problem is:
$('#Janela' + idJanela).data('tWindow') returns an undefined value. What leads me to believe that Telerik Window client-side API hasn't been loaded at all.
But that doesn't make any sense to me, since telerik.window.min.js is properly added on the scripts (I've checked through Firebug)
Any tips on how to solve this? :(
I'm trying to open an invisible Window through Client-side API, here's my view:
@{ ViewBag.Title = "Home Page"; Layout = null;}@using LogosSDK.Entidades@model IEnumerable<IconeDesktop><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.hay.css").Add("webdesktop.css").Combined(false).Compress(false))) <script type="text/javascript"> function Pronto() { Resize(); $(window).resize(Resize); $(".atalho").draggable({ containment: "#desktop", grid: [8, 8], scrollSpeed: 10 }); $(".atalho").click(function () { $(".atalho").css("background-color", "transparent"); $(this).css("background-color", "#F39814"); }); $(".atalho").dblclick(function () { AbrirNovaJanela(this.id); }); } function Resize() { var heightDesktop = window.innerHeight; //- $("#taskbar").height(); //heightDesktop = heightDesktop - (heightDesktop * 0.02); $("#desktop").height(heightDesktop + "px"); } function AbrirNovaJanela(idJanela) { $('#Janela' + idJanela).data('tWindow').open(); } </script></head><body><form id="frmDesktop"> <div id="desktop"> <ol id="iconesDesktop"> @foreach (var icone in Model) { <div id="Icone@(icone.Id)" title="@icone.ItemMenu.Texto" urlAlvo="@icone.ItemMenu.Acao" class="atalho"> <div class="icone-atalho"> <img title="@icone.ItemMenu.Texto" class="imagem-icone" src="@Url.Content("~/Content/Icones/" + @icone.ItemMenu.Imagem)"/> </div> <span class="texto-atalho">@icone.ItemMenu.Texto</span> </div> } </ol> </div> <div><input type="button" value="teste" onclick="teste();" /></div> @{ foreach (var icone in Model) { Html.Telerik().Window() .Name("JanelaIcone" + icone.Id).LoadContentFrom(icone.ItemMenu.Acao.Split('#')[0], icone.ItemMenu.Acao.Split('#')[1]) .Visible(false) .Render(); } }</form>@(Html.Telerik().ScriptRegistrar().jQuery(true).jQueryValidation(false).DefaultGroup(group => group.Add("jquery-ui.js").Combined(true).Compress(false)).OnDocumentReady("Pronto();"))</body> My problem is:
$('#Janela' + idJanela).data('tWindow') returns an undefined value. What leads me to believe that Telerik Window client-side API hasn't been loaded at all.
But that doesn't make any sense to me, since telerik.window.min.js is properly added on the scripts (I've checked through Firebug)
Any tips on how to solve this? :(