Dependent/Cascading inputs using Deform

烈酒焚心 提交于 2019-12-02 03:49:16

问题


I'm trying to do a series of dependent inputs with Deform / Colander / Chameleon / Pyramid and can't find any examples. e.g.

Dropdown of Country yields->

Dropdown of State or Province or Division ..etc.. yields->

Dropdown of County or City ... might yield->

Dropdown of City ...

Can this be accomplished using Deform? (if it can't, should I look at an alternative form generating solution or go pure html/javascript/ajax/..?)

I'm simplifying this to geographic divisions. I'd prefer to send only the necessary part of the 12 million record database at the time the form is loaded and incrementally narrow as choices are made.

Here's a link to Deform's examples page: http://deformdemo.repoze.org/select_with_deferred/


回答1:


This is so-called master/slave widget issue and it is not possible to solve this in HTML UI without JavaScript.

I would suggest you render full widgets with Deform and then write the showing/hiding logic in JavaScript.

A JavaScript / jQuery library a wrote long time ago to address use cases like this.



来源:https://stackoverflow.com/questions/28516980/dependent-cascading-inputs-using-deform

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!