I have tried different ways of displaying date in grid column and implementing click event for grid row.
My requirements are:
1 Display date in grid column when date in my object is of form: "dateval": "2014-09-05T16:19:39 +04:00"
My data:
data: [
{
"age": 13,
"name": "Ben Watson",
"gender": "male",
"phone": "+1 (548) 314-8928",
"registered": "2014-09-05T16:19:39 +04:00"
}
code:
function render_date(val) {
val = Ext.util.Format.date(val, 'Y-m-d');
return val;
}
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Age', dataIndex: 'age' },
{
text: 'Registered',
dataIndex: 'registered',
type: 'date',
dateFormat: 'timestamp',
renderer: render_date
}
]
2 When the user clicks a grid row in a panel, display the data in the row in the adjacent panel.
I am using ext.define and extend in this application