|
Title: Init a dateBox with today Post by: yamilbracho on July 21, 2015, 08:33:28 AM I would like to init a datebox with today. I do this in my ready event
Code: $(document).ready(function () { However, in the console i got Uncaught TypeError: Cannot read property 'options' of undefined My html code is Code: Desde: <input id="desde" is there something i forgot ? Title: Re: Init a dateBox with today Post by: jarry on July 21, 2015, 08:56:59 AM The datebox value should be a string. Please try this.
Code: var v=Rutinas.dateFormatter.call($('#desde')[0],new Date());Title: Re: Init a dateBox with today Post by: yamilbracho on July 21, 2015, 10:40:15 AM Thanks
I changed my code as your suggestion: Code: var v = Rutinas.dateFormatter.call($('#desde')[0],new Date());but in the console i got Code: v=21/07/2015 Anything else i could check? Title: Re: Init a dateBox with today Post by: jarry on July 21, 2015, 07:01:29 PM Please check your 'formatter' and 'parser' functions carefully to see if some errors occur.
Title: Re: Init a dateBox with today Post by: yamilbracho on July 22, 2015, 08:06:23 AM Thanks!
My parser and format code are working fine, those are : Code: dateFormatter: function(date) {Title: Re: Init a dateBox with today Post by: jarry on July 22, 2015, 08:32:04 AM Here is the example http://jsfiddle.net/xyn9ym00/. It works fine.
Title: Re: Init a dateBox with today Post by: yamilbracho on July 22, 2015, 11:51:28 AM Thanks a lot!!!
I don't knwo what it's going on but I cut and paste the code in my html page and does not work!! >:( Code: console.log('Before opts');In the console I got Before opts jquery.easyui.min.js:6696 Uncaught TypeError: Cannot read property 'options' of undefined So it got problems with this line var opts = $('#desde').datebox('options'); desde is defined as : Code: Desde: <input id="desde" Another suggestion ? |