extjs表格编辑,单元格用日期刚开始我直接在column里面写:
editor: { xtype: 'datefield', format: "Y-m-d" },
但是选择完后,表格中显示的不是我想要的。
后来翻文档才发现column也要定义成datecolumn
完整代码如下:
xtype: 'grid', width:"100%", name: "modifyHistoryGrid", columnLines: true, height: 150, plugins: { ptype: 'cellediting', clicksToEdit: 1 }, store: { fields: ['productPlanDate', 'description', 'createTime'], data:[{}] }, columns: [{ text: '计划货期', width: 200, dataIndex: 'productPlanDate', xtype: "datecolumn", format: "Y-m-d", editor: { xtype: 'datefield', format: "Y-m-d" }, renderer:function (value) { return value&&value.indexOf(" ")!=-1?value.split(" ")[0]:""; } }, { text: '备注', width: 150, flex: 1, dataIndex: 'description', editor: { } }