我需要在网格上显示4个不同的日期字段.其中2个将直接显示为列,并且在展开行时所有这些都将可见.
我正在使用ExtJS 4.2.1
网格以我想要的格式显示日期(如27-12-2013 11:30),但我不能使扩展区域显示格式化日期.
我从java添加日期到Json,如下所示.
if(account.getCreated() != null)
accountJson.put("created", new SimpleDateFormat("yyyy/MM/dd hh:mm").format(account.getCreated()));
if(account.getModified() != null)
accountJson.put("modified", new SimpleDateFormat("yyyy/MM/dd hh:mm").format(account.getModified()));
if(account.getBeginDate() != null)
accountJson.put("beginDate", new SimpleDateFormat("yyyy/MM/dd hh:mm").format(account.getBeginDate()));
if(account.getEndDate() != null)
accountJson.put("endDate", new SimpleDateFormat("yyyy/MM/dd hh:mm").format(account.getEndDate()));
Run Code Online (Sandbox Code Playgroud)
我的ext js字段:
........
{name: "created", type: 'date'},
{name: "modified", type: 'date'},
{name: "beginDate", type: 'date'},
{name: "endDate", type: 'date'}
Run Code Online (Sandbox Code Playgroud)
网格列:
{text: 'Ba?lang?ç Tarihi', sortable: true, dataIndex: 'beginDate', renderer: Ext.util.Format.dateRenderer('d-m-Y H:i')},
{text: 'Biti? Zaman?', sortable: …
Run Code Online (Sandbox Code Playgroud)