Extjs 开/关时间(日期时间字段)不';按下“取消”按钮后,t清除
我打开页面属性并填写一些字段 在我按下“取消”按钮并重新打开“属性”对话框后,所有字段都被清除,但datetime字段没有Extjs 开/关时间(日期时间字段)不';按下“取消”按钮后,t清除,extjs,widget,aem,Extjs,Widget,Aem,我打开页面属性并填写一些字段 在我按下“取消”按钮并重新打开“属性”对话框后,所有字段都被清除,但datetime字段没有 清除日期时间字段的正确方法是什么?我在\ibs\cq\ui\widgets\source\ext\override\widgets\form\Field.js中调试并发现isApplyDefault方法的奇怪行为。如果它们等于,则返回true,否则返回false 我只是在DateTime.js中使用ovveride方法processRecord来删除调用isApplyD
清除日期时间字段的正确方法是什么?我在
\ibs\cq\ui\widgets\source\ext\override\widgets\form\Field.js中调试并发现isApplyDefault方法的奇怪行为。如果它们等于,则返回true,否则返回false
我只是在DateTime.js中使用ovveride方法processRecord来删除调用isApplyDefault:
processRecord: function(record, path) {
if (this.fireEvent('beforeloadcontent', this, record, path) !== false) {
var v = record.get(this.getName());
if (v == undefined && this.defaultValue != null) {
this.setValue(this.defaultValue);
}
else {
this.setValue(v);
}
this.fireEvent('loadcontent', this, record, path);
}
}
在Field.js中,它是:
processRecord: function(record, path) {
if (this.fireEvent('beforeloadcontent', this, record, path) !== false) {
var v = record.get(this.getName());
if (v == undefined && this.defaultValue != null) {
if (this.isApplyDefault(record, path)) {
this.setValue(this.defaultValue);
}
}
else {
this.setValue(v);
}
this.fireEvent('loadcontent', this, record, path);
}
}
另见