HTML客户端:originalValue =未定义 [英] HTML Client: originalValue = undefined
问题描述
我想在客户端JavaScript更改监听器中比较新旧值.每次我检查contentItem.originalValue时,它都是未定义的.该属性在那里,只是未设置.有什么想法吗?
I want to compare old and new values in a client-side JavaScript change listener. Every time I check contentItem.originalValue it is undefined. The property is there it's just not set. Any ideas?
这是SL客户端的方法:
This is the way for SL client:
乔什
推荐答案
我也没有看到使用过originalValue.在dataBind函数中,contentItem在范围外,但作为 此仍保留对其原始数据的引用.
I haven't seen originalValue used either. In the dataBind function contentItem is out-of-scope but is passed as this which still keeps a reference to its original data.
以屏幕属性名字"为例:
As an example for a screen property Firstname:
myapp.AddEditEngineer.Firstname_postRender = function (element, contentItem) {
// Write code here.
contentItem.dataBind('value', function (newValue) {
if (this.bindingSource.data.Firstname === this.value)
console.log('No changes');
else {
console.log(newValue);
}
});
};
...将区分新值和原始值.
...will distinguish between a new and original values.
这篇关于HTML客户端:originalValue =未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!