-
18 Aug 2011 11:30 AM #1
Answered: Formatting date in rowexpander xtemplate
Answered: Formatting date in rowexpander xtemplate
I Know there are several forum threads about this but none of the solutions work for me.
In my xtemplate for my row expander I have a date field that I want to format
the function getRowBodyXTemplate returns the xtemplate string which is like thisCode:plugins: [{ ptype: 'rowexpander', rowBodyTpl: this.something.getRowBodyXTemplate() }],
it's the discovered_at Date that i need to format.Code:'<td > <p> discovered {discovered_at}</p> </td>'
it's specified in the model as
and i tried this but my date came up undefinedCode:{ name: 'discovered_at', type: 'date'},
help?Code:{ name: 'discovered_at', type: 'date', dateFormat: 'n-j-Y g:i A'},
-
Best Answer Posted by stevil
Try reverting your model to
, and changing your template string to:Code:{ name: 'discovered_at', type: 'auto' },
http://docs.sencha.com/ext-js/4-0/#/api/Ext.util.Format gives other examples of what you can do with format functions in templates.Code:'<td><p> discovered {discovered_at:date("n-j-Y g:i A")}</p></td>'
hope this helps,
stevil
-
18 Aug 2011 12:13 PM #2
Try reverting your model to
, and changing your template string to:Code:{ name: 'discovered_at', type: 'auto' },
http://docs.sencha.com/ext-js/4-0/#/api/Ext.util.Format gives other examples of what you can do with format functions in templates.Code:'<td><p> discovered {discovered_at:date("n-j-Y g:i A")}</p></td>'
hope this helps,
stevil
-
18 Aug 2011 12:18 PM #3


Reply With Quote