保留单元格的现有值以在单击时进行编辑 [英] Retain the already present value of the cell for edit on click
问题描述
我有一个带有 xtype:datecolumn 的网格列,如下所示,现在发生的情况是当我想更改单元格的值时,即更改单击时的时间,单元格变为空白以进行编辑,并且在单击之前的值返回的方式时,我希望在单击时显示该值以进行编辑
I've a grid cloumn with xtype:datecolumn as below, Now what happens is when i want to alter the value of the cell , i.e change the time on click the cell becomes blank for editing and on clicking way the previous value comes back, I want the value to be present to edit on click
这是我的网格列
{
text: ' Time',
dataIndex: 'time',
xtype: 'datecolumn',
format: 'Y-m-d H:i:s',
editor: {
xtype: 'datefield',
format: 'Y-m-d H:i:s',
allowBlank: false,
maskRe: /[0-9,:,-]/
}
},
我将如何实现这一目标?编辑相同的旧值而不是空白并选择新日期谢谢
How will I be achieve this? To edit the same old value rather than going blank and choosing the new date Thanks
推荐答案
是格式问题,我修好了..我从数据库中获取格式为 m/d/YH:m:s
的数据,网格中的格式是 Ymd H:m:s
更改后端的格式解决了这个问题.
It was the format issue, I fixed it..
I was getting the data from the db with the format m/d/Y H:m:s
and the the format in the grid was Y-m-d H:m:s
changing the format in the backend fixed the issue.
感谢@UDID 指点我进行调试.
Thanks @UDID for pointing me to debugging.
这篇关于保留单元格的现有值以在单击时进行编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!