我有一个公共事件处理程序,用于更改动态创建的属性浏览器的值(属性名称和属性值的键值值)。我在哪里创建KVP的控件,具体取决于属性的类型。
//Property Object
function PropertyValue(
PropertyName,
PropertyValue,
PropertyType,
PropertyValueList
) {
this.PropertyName = PropertyName;
this.PropertyValue = PropertyValue;
this.PropertyType = PropertyType;
this.PropertyValueList = PropertyValueList;
}
//List of Objects for the Property Browser.
var propertyList = [];
现在我正在创建控件类型,如(ComboBox,ColorPicker,CheckBox,TextBox),具体取决于 PropertyType 值。我有一个公共事件来获取通知。
function OnUpdate(event) {
var element = event.target;
UpdateProperty(element.id);
alert(element.id + ":" +element.value);
}
此属性值用于在画布上绘制的图表控件,并在每250毫秒重绘一次(SetInter
中调用的自定义重绘功能)。我希望在更改属性浏览器中的任何属性值后立即更新值更改。
我不想更新数组中的值,然后遍历循环以获取更新的值。
谢谢, Arijit
答案 0 :(得分:0)
window.PropertyType.addEventListener('stateChange', function() {
if (PropertyType= //value or range or values) {
//execute change
}
else (PropertyType= //value or range or values) {
//execute change
}
我不认为我完全理解这个问题,但如果只有这么多的状态改变选项,那么迭代通过ifelse循环的监听器可以做到这一点吗?