-
3 Jan 2013 3:13 AM #1
Ext.grid.GridPanel Showing NaN Date on IE
Ext.grid.GridPanel Showing NaN Date on IE
function renderDate(value) { return Ext.util.Format.date(value, 'F d, Y g:i A'); }
this.testsGrid = new Ext.grid.GridPanel({ id: 'testsGrid', region: 'center', deferRowRender: true, store: this.testsStore, loadMask: true, viewConfig: { forceFit: true }, autoWidth: true, columns: [ { id: 'LogId', header: 'Log ID', sortable: true, dataIndex: 'LogId' }, {id: 'ShortName', header: 'Short Name', sortable: true, dataIndex: 'ShortName' }, { id: 'LogInDate', header: 'Log Date', sortable: true, dataIndex: 'LogInDate', renderer: renderDate } ], stripeRows: true, autoScroll: true, border: false });
Above code will show correct date format on Chrome but will only display NaN on IE. Can somebody help me? Thanks...
-
3 Jan 2013 6:19 PM #2
value by the way has this value '2012, 02, 30'
I really need a help.
-
4 Jan 2013 2:11 AM #3
http://docs.sencha.com/ext-js/3-4/#!...at-method-dateThe value to format (Strings must conform to the format expected by the javascript Date object's parse() method)
http://www.w3schools.com/jsref/jsref_parse.asp
You cannot supply the date format as '2012, 02, 30' - this is an invalid format.
Example:
http://jsfiddle.net/qex8D/2/
-
4 Jan 2013 1:01 PM #4
If by 2012,02,30 the 30th of March(!) is meant then he could simply try
it's quickn dirty, but should work.PHP Code:function renderDate(value) {return Ext.util.Format.date(eval("new Date("+value+")"), 'F d, Y g:i A');}
Extensions:
Ext.ux.DatePickerPlus (Multimonth,Multiselect,...)
Ext.ux.menu.StoreMenu - Ajax Store as menu-item config
Extended Window - Aero Shadows, nested grayscaled modal windows
Ext.MessageBox.promptCombo/promptRadio/promptCheckbox
Ext.ux.plugin.triggerfieldTooltip (for Comboboxes, Datefields...)
Ext.util.MD5
Ext.util.Utf8 (encode/decode)
Ext.util.base64 (encode/decode)
Using:
ExtJS 3.4.1.1/4.2
XPsp3/W7sp1
IE8/9/10
FF 20
Chrome 26


Reply With Quote