描述错误
当 dataGrid 使单元格可编辑时,如果没有 cellText,它会获取字段值。 我们应用程序中的字段值对于空白日期值具有零。 日期编辑器以零打开。
下面是被引用的代码。
makeCellEditable: function(row, cell, event) {
if (!this.isCellEditable(row, cell)) {
return;
}
//Locate the Editor
var col = this.columnSettings(cell);
if (!col.editor) {
if (event.keyCode === 32) {
this.toggleRowSelection(this.activeCell.node.closest('tr'));
}
return;
}
// Put the Cell into Focus Mode
this.setActiveCell(row, cell);
var cellNode = this.activeCell.node.find('.datagrid-cell-wrapper'),
cellParent = cellNode.parent('td'),
cellValue = (cellNode.text() ? cellNode.text() : this.fieldValue(this.settings.dataset[row], col.field));
if (cellParent.hasClass('is-editing')) {
//Already in edit mode
//Editor.focus
cellNode.find('input').focus();
return false;
}
再现
重现行为的步骤:
预期行为
预计如果没有单元格文本,则传递空字符串或格式化字段值。
仅供参考:3.5 控件提供了回调,允许在使用编辑器中的值之前更改字段值。
我认为 0000000 似乎是语言环境转换错误。
但除此之外,回调是一个不错的主意,因为它允许将来进行自定义。
@boehmd1您能否提供复制此问题的步骤? 问题描述中的“重现”部分尚未更新/更改。 谢谢。
很好的电话 - 我以为我复制了这个,但我不确定数据实际上会设置为什么。 如果我尝试这个例子: http://localhost :4000/components/datagrid/example-editable.html 那么有一些空白数据在网格中没有 0000000 的情况下呈现正常。 数据示例是否类似于:字符串 '00000000' ?
另外@boehmd1 3.5 中的选项是什么?
'loadValue' 是编辑器上的一个方法。
为了重现...
使用示例http://localhost :4000/components/datagrid/example-editable
更改日期或 OrderDate '00000000'
@davidcarlsonberg loadData
是编辑器的一个钩子。 我们可能可以将 Locale 格式00000000
正确设置为空日期来解决这个问题。 然后,如果我们想在编辑器中添加一个钩子,我们可以另外这样做。
质量检查通过。 移动 t 完成。
在所有设备、浏览器和操作系统中测试: http://localhost :4000/components/datagrid/example-editable。