jQWidgets Forums
jQuery UI Widgets › Forums › General Discussions › Editors › DateTimeInput › Setting ‘null’ causes “Too much recursion” in Firefox
Tagged: calendar
This topic contains 4 replies, has 2 voices, and was last updated by DLadner 11 years, 12 months ago.
-
Author
-
I am using the DateTimeInput control on an entry form that is reset to a blank entry before later being (optionally) filled with a value from the database.
As per the API documentation, I set the control to a blank entry by sending a “null” value:
$(‘#Calendar’).jqxDateTimeInput(‘setDate’, null);
This works great, and I’m not having any problems with it on Google Chrome or Internet Explorer. However, in Firefox, the control sets to “null” correctly the first 2 -3 times, but after that, Firefox throws a “Too much recursion” exception message in the Web Console.
I’m using jqxWidgets version 2.9.3, Firefox version 22.0 and jQuery version 1.10.2 .
Hi DLadner,
I am pretty sure that this would never happen if you close the browser’s debugger.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter, unfortunately I am seeing it happen in Firefox even without the debugger open. I don’t see the ‘Too much recursion’ error of course, but script execution halts at the “setDate” line of code.
Hi DLadner,
I am sorry, but using FF 22.0 and jQWidgets 2.9.3, I cannot reproduce such behavior.
Here’s my test sample:
<!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> <meta name="keywords" content="jQuery Calendar, Month Calendar, MonthCalendar, DateTimeInput, DateTimePicker, Date Picker" /> <meta name="description" content="This demo demonstrates the jqxDateTimeInput widget. Click the calendar button to open the popup and select a date from the calendar. You can also enter a date by typing into the jqxDateTimeInput text input field." /> <title id='Description'>This demo demonstrates the jqxDateTimeInput widget. Click the calendar button to open the popup and select a date from the calendar. You can also enter a date by typing into the jqxDateTimeInput text input field. </title> <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" /> <script type="text/javascript" src="../../scripts/jquery-1.10.1.min.js"></script> <script type="text/javascript" src="../../scripts/gettheme.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxdatetimeinput.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxcalendar.js"></script> <script type="text/javascript" src="../../jqwidgets/jqxtooltip.js"></script> <script type="text/javascript" src="../../jqwidgets/globalization/globalize.js"></script></head><body> <div id='content'> <script type="text/javascript"> $(document).ready(function () { var theme = getDemoTheme(); // Create a jqxDateTimeInput $("#jqxWidget").jqxDateTimeInput({width: '250px', height: '25px', theme: theme}); $("#button").click(function () { $("#jqxWidget").jqxDateTimeInput('setDate', null); }); }); </script> <div id='jqxWidget'> </div> <input value="Clear" type="button" id="button" /> </div></body></html>
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/I was unable to reproduce it with your code Peter. My page is complex, so there must be something buried within the complexity that is causing the error.
I was able to work-around the Firefox error by using setTimeout:
window.setTimeout(“$(‘#Calendar’).jqxDateTimeInput(‘setDate’, null);”, 5);
With this code, I no longer get the “Too much recursion” error.
-
AuthorPosts
You must be logged in to reply to this topic.