[英]Zend Framework: Form: How do I create a extremely custom element(s)
I will start by saying that I am familiar with Zend Form, and its options/decorators etc, I am looking for some guidance on how best to execute this type of form, also the system uses jQuery, and jQuery-UI so, we can use them too, I should also mention that I do not require advice of the model, ie how to save the info, I need help with rendering this type of form, I suspect I will need to use view helpers, and cusom form elements? 首先,我要熟悉Zend Form及其选项/修饰符等,我正在寻找一些有关如何最好地执行这种形式的表单的指南,而且系统使用jQuery和jQuery-UI,因此,我们可以也使用它们,我还应该提到我不需要模型的建议,即如何保存信息,我需要呈现这种类型的表单的帮助,我怀疑我将需要使用视图助手和cusom表单元素?
The problem: 问题:
My app has a page which links "products" to a "customer". 我的应用程序有一个页面,该页面将“产品”链接到“客户”。 "products" have a default price, but this can be overridden per customer, this needs to be factored in, I must be able to select from the list of standard products which ones the customer has purchased, override its default price, as well as add any number of custom products on the fly, as such:
“产品”具有默认价格,但是每个客户都可以覆盖此默认价格,因此需要考虑这一点。我必须能够从标准产品列表中选择客户购买的产品,覆盖其默认价格以及快速添加任意数量的定制产品,例如:
The Form: 表格:
Customer: John Doe 客户:John Doe
Products (X are selected to be linked to customer): 产品 (选择X以链接到客户):
[ ] Blah Product/Service [$32.00] [] Blah产品/服务[$ 32.00]
[X] Foo Service [$23.45] [X] Foo服务[$ 23.45]
Additional products/services (inputs): 其他产品/服务 (输入):
Product Name: [Input] Cost ($): [input] Description: [Input] 产品名称:[输入]成本($):[输入]说明:[输入]
Add service: [Button] <-- Possibly "update the form to add a new set of (above) inputs" 添加服务:[按钮] <-可能是“更新表单以添加一组新的(上方)输入”
Save customer record: [Button] 保存客户记录:[按钮]
Thanks for your help guys, Jay 谢谢您的帮助,杰伊
Doesn't seem to me that this form is going to be as custom as you might think. 在我看来,这种形式不会像您想象的那样习惯。
The trick is in the dynamic addition of products on the fly. 诀窍在于动态添加产品。 Towards that end, see Jeremy Kendall's excellent post on the subject:
为此,请参见Jeremy Kendall关于该主题的出色文章:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.