Forum
19:12
03/03/2013
When the editrules for 'date' are set to true an error appears on line 5983: "Uncaught TypeError: cannot set property '1' of undefined".
Appears that "this" needs a JQuery-reference.
I changed "this" by "$(this)" (4 times in this function) and the function works.
Same error reported in the help-forum :
/blog/?page_id=393/help/jqgrid-4-4-4-javascript-error-this-p-is-undefined-in-line-8663/
Mork
10:06
Moderators
30/10/2007
Hello,
A simple test case is greatly appreciated.
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
23:31
23/03/2013
I can confirm the same error occurs in IE 10.
My column definition (a work in progress) looks like this:
{ name: "Date", index: "Date", width: 72, formatter: 'date', formatoptions: { srcformat: 'm/d/Y', newformat: 'm/d/Y', defaultValue:null }, editable: true, editrules: { required: true, date: true }, editoptions: { size: 20, dataInit: function (el) { $(el).datepicker(); } } },
I was able to work-around the bug by changing the function block at line 5980 like so:
daysArray = function(n) { var i, a = new Array(n); for (i = 1; i <= n; i++) { a[i] = 31; if (i==4 || i==6 || i==9 || i==11) {a[i] = 30;} if (i==2) {a[i] = 29;} } return a; };
On a related note, why pass 12 in? The number of months in a year isn't likely to change in our lifetime.
in which case this function can be:
daysArray = function() {return new Array(0,31,29,31,30,31,30,31,31,30,31,30,31)}
09:14
Moderators
30/10/2007
Hello,
Thanks for this. Also you are right. This was a code from the time where we begin with javaScript .
Fixed
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
Most Users Ever Online: 715
Currently Online:
84 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66