This is a migrated thread and some comments may be shown as answers.
Invalid argument jquery-1.4.3.js when opening a Window control that is set to Visible(false)
4 Answers 54 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brad Sumner
Top achievements
Rank 1
Brad Sumner asked on 11 Nov 2010, 08:52 PM

I’m getting the following error when trying to open a window control when Visible is set to false after upgrading to version  2010.3.1110.235 of Telerik.Web.Mvc.dll.  I was not getting the error on the previous version.  The error is ‘Invalid argument jquery-1.4.3.js, line 6489 character 21’


The jquery line is:
_default: function (fx) {
                if (fx.elem.style && fx.elem.style[fx.prop] != null) {
                    fx.elem.style[fx.prop] = (fx.prop === "width" || fx.prop === "height" ? Math.max(0, fx.now) : fx.now) + fx.unit;
                } else {
                    fx.elem[fx.prop] = fx.now;
                }
            }

The window will popup displaying the content and the javascript error is thrown.   When you close the window and re-open, the window opens but the content does not display.  If I set the window to Visible(true) and load the page the window pops up fine and you are able to open and close with the content showing up fine.

<% Html.Telerik().Window()
    .Name("Window")
    .Content(() =>
    {%>  
        <p>Test Content</p>
    <%})
    .Buttons(buttons => buttons.Close())
    .Width(450)
    .Draggable(true)
    .Visible(false)
    .Render();      
    %>
          
    <button onclick="openWindow()">Open</button>
          
    <script type="text/javascript">
  
        function openWindow() { var window = $("#Window").data("tWindow"); window.open(); }    
      
    </script>

I’m not sure if I’m missing something simple or if this is a bug.  I’m referencing the new version and I copied the style sheets and scripts to the correct location and they are referenced correctly on the page. 

I can also duplicate the error if I set the Window to visible on page load and use HtmlAttributes
to set style="display:none" for the window.

Thanks in advance
-Brad

4 Answers, 1 is accepted

Sort by
0
Accepted
Hristo Germanov
Telerik team
answered on 12 Nov 2010, 05:46 PM
Hello Brad Sumner,

Thank you for reporting this issue.

I confirm that it is a bug, which will be fixed with next official release of Telerik Components for ASP.NET MVC.

Attached is the modified javascript file.

I have updated your Telerik points.

Sincerely yours,
Hristo Germanov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Brad Sumner
Top achievements
Rank 1
answered on 12 Nov 2010, 08:13 PM
Thanks for the update!

Brad
0
Ozzy Knox
Top achievements
Rank 1
answered on 23 Nov 2010, 04:13 PM
Extremely helpful post. I thought I was doing something wrong. Thanks for the quick response with a patch.

Ozzy
0
Chris
Top achievements
Rank 1
answered on 31 Dec 2010, 01:39 AM
While this seems to remove the javascript exception, it causes the dialog not to display correctly.  Nevermind about this, it was the fact that the latest change also meant you need to specify a Width() and a modal window no longer centers automatically.

Still, you should provide the NON-MINIMIZED change for those of us with custom code-bases.
Tags
Window
Asked by
Brad Sumner
Top achievements
Rank 1
Answers by
Hristo Germanov
Telerik team
Brad Sumner
Top achievements
Rank 1
Ozzy Knox
Top achievements
Rank 1
Chris
Top achievements
Rank 1
Share this question
or