简体   繁体   English

如何为网页创建复杂的数据绑定 <select>盒子?

[英]How to create complex data-bindings for webpage <select> boxes?

I'm building a database query wizard on Google App Engine. 我正在Google App Engine上构建数据库查询向导。 For the browser front-end, I need some dynamic data-binding between boxes/menus on the webpage. 对于浏览器前端,我需要在网页上的框/菜单之间进行一些动态数据绑定。

Specifically, when SelectBoxA is changed, a bunch of other Selectboxes should be updated (basically menus of attributes from the selected table. schema stored in an array). 具体来说,当SelectBoxA发生变化时,应该更新一堆其他Selectbox(基本上是选定表中的属性菜单。存储在数组中的模式)。 The thing is there can be an arbitrary number of those depending on how many elements the user adds to their query. 事情是可以有任意数量的那些取决于用户添加到他们的查询的元素数量。 Finally, SelectBoxZ should sort of keep track of what elements have been added, so it must be dynamically updated/populated too. 最后,SelectBoxZ应该跟踪已添加的元素,因此必须动态更新/填充它。

Any solution involving Javascript is ok, or alternatively using interactions with the server (with Ajax or Python or whatever). 任何涉及Javascript的解决方案都可以,或者使用与服务器的交互(使用Ajax或Python或其他)。

I've experimented with Knockout JS, but I can only seem to get a single view model working at a time and I don't think it will handle new elements being added to the page very easily. 我已经尝试过使用Knockout JS,但我似乎只能让一个单一的视图模型一次工作,我认为它不会很容易地处理添加到页面中的新元素。 Also looked at Backbone JS but from the documentation given, I can't figure out how to go about it. 还看了Backbone JS,但从给出的文档中,我无法弄清楚如何去做。

Any advice, solutions or examples of similar projects on the web would be greatly appreciated. 任何有关网络上类似项目的建议,解决方案或示例都将不胜感激。

Did you take a look at ProtoRPC ? 你看过ProtoRPC了吗?

In the announcement blob post they show how to use it with jQuery. 公告blob帖子中,他们展示了如何将它与jQuery一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM