您好!
当我在调试器中更改变量时、文本框不会更新、反之亦然。
请 有人解释 getter 和设置函数如何与 GUI 和目标交互。
谢谢、
斯蒂芬
document.addEventListener('gc-databind-ready', function()
{
/*
* Add custom computed value databindings here, using the following method:
*
* function gc.databind.registry.bind(targetBinding, modelBinding, [getter], [setter]);
*
* param targetBinding - single binding string or expression, or array of binding strings for multi-way binding.
* param modelBinding - single binding string or expression, or array of binding strings for multi-way binding.
* param getter - (optional) - custom getter function for computing the targetBinding value(s) based on modelBinding value(s).
* param setter - (optional) - custom setter function for computing the modelBinding value(s) based on targetBinding value(s).
*/
// For example, a simple computed values based on simple expression
// gc.databind.registry.bind('widget.id.propertyName', "targetVariable == 1 ? 'binding is one' : 'binding is not one'");
// Or a custom two-way binding with custome getter and setter functions. (setter is optional) (getter only indicates one-way binding)
// gc.databind.registry.bind('widget.id.propertyName', "targetVariable", function(value) { return value*5/9 + 32; }, function(value) { (return value-32)*9/5; });
// Event 1 to n bindings
gc.databind.registry.bind('abc',
// dependant bindings needed in order to compute the date, in name/value pairs.
"widget.ti_widget_textbox_abc",
function(value)
{
// compute and return the string value to bind to the widget with id 'date'
return value*2;
},
function(value)
{
// compute and return the string value to bind to the widget with id 'date'
return value/2;
}
);
}