来自不同 qooxdoo 类的双向绑定
我正在尝试绑定来自两个单独的 qooxdoo 类的两个滑块,并且正在寻找一个示例。我能够在操场上获得所需的效果:
// create two sliders
var slider1 = new qx.ui.form.Slider().set({minWidth:400});
var slider2 = new qx.ui.form.Slider().set({minWidth:400});
// create a controller and use the first slider as a model
var controller = new qx.data.controller.Object(slider1);
var controller2 = new qx.data.controller.Object(slider2);
// add the second slider as a target
controller.addTarget(slider2, "value", "value");
controller2.addTarget(slider1, "value", "value");
我很确定要执行此操作,我必须检查属性对象,但首先要确保到目前为止我的逻辑处于正确的轨道上。感谢您的任何建议!
I'm trying to bind two sliders from two separate qooxdoo classes and am looking for an example. I was able to get the desired effect in the playground here:
// create two sliders
var slider1 = new qx.ui.form.Slider().set({minWidth:400});
var slider2 = new qx.ui.form.Slider().set({minWidth:400});
// create a controller and use the first slider as a model
var controller = new qx.data.controller.Object(slider1);
var controller2 = new qx.data.controller.Object(slider2);
// add the second slider as a target
controller.addTarget(slider2, "value", "value");
controller2.addTarget(slider1, "value", "value");
I'm pretty sure to do this I would have to go through the properties object, but first wanted to make sure that I'm on the right track so far with the logic. Thanks for any suggestions!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要使用控制器。每个qooxdoo对象都有bind方法,可以双向使用:
基本上就是这样: http://tinyurl.com/7xy9mmv
You don't need to use the controller. Every qooxdoo objects has the bind method, which can be used in both directions:
Thats basically it: http://tinyurl.com/7xy9mmv