-
27 Oct 2011 7:47 AM #1
Answered: Uncaught TypeError: Object [object DOMWindow] has no method 'getDate'
Answered: Uncaught TypeError: Object [object DOMWindow] has no method 'getDate'
Hi I am trying to format date as below
datetime = Ext.Date.format(grid.data.date_time,'d/m/y H:i');
when I save the record it saves properly in the above format, but I am getting the error at console.
Uncaught TypeError: Object [object DOMWindow] has no method 'getDate'
When I expand this error message, in the js file, it was pointing to above line of code, please let me know, am I doing the right way of conversion. I am using extjs 4.0.7
-
Best Answer Posted by skirtle
Please always post the full stacktrace (with line numbers) when requesting help with an error.
It seems that grid.data.date_time is undefined. console.log() it on the line before to confirm.
-
27 Oct 2011 8:02 AM #2
Please always post the full stacktrace (with line numbers) when requesting help with an error.
It seems that grid.data.date_time is undefined. console.log() it on the line before to confirm.
-
27 Oct 2011 8:22 AM #3
Yes it could be coz initially when I load my gridpanel date field is empty initially
when i enter date and format then it suppose to save in database.
when I changed my code from Ext.Date.format to Ext.util.Format.date it is working fine,
Can you please suggest me how to set default value to date field before I load gridpanel.
The scenario is when I load panel, my gridpanel has two columns as empty with the help of cell editing i enter the date, the initially datefield displays as nothing . please suggest to set default value for datefield in gridpanel.
my datefield defined in gridpanel as below :
-
27 Oct 2011 8:25 AM #4
Code:{ header : 'Date/Time', name : 'date_time', dataIndex : 'date_time', id : 'date_time', renderer : Ext.util.Format.dateRenderer('d/m/Y H:i'), width : 175, editor : { xtype : 'xdatetime', value : Ext.Date.format(new Date(),'d/m/Y H:i'), dateFormat : 'd/m/Y', timeFormat : 'H:i' }, allowBlank : true }
-
29 Oct 2011 3:50 AM #5
-
29 Oct 2011 4:20 AM #6
yes it is. If I add single row only for other rows i get this message. but I am not sure how to fix it.


Reply With Quote
