在 modx 中打印表格以通过 eForm 发送邮件信息
我的问题是,如何创建一个包含动态字段的表(稍后我将对此进行解释),并使用 eform 通过邮件向它们发送值?
在左侧的表中,我想打印使用模板 XX 的所有文档子级,在顶部,我希望用户指定他想要的列数(除了产品/文档列)并给出名称对于他们来说。这是为了为同时订购大量产品的买家创建一个基于桌面的商店。如果买家有 3 个客户,他说他想要 3 个名称为“Row1”、“Row2”和“Row3”的列,所以会是这样的:
Row1 Row2 Row3 Total
Product1 [0] [0] [0] 0
Product2 [0] [0] [0] 0
Product3 [0] [0] [0] 0
Product4 [0] [0] [0] 0
Product5 [0] [0] [0] 0
Product6 [0] [0] [20] 20
Product7 [0] [0] [0] 0
Product8 [0] [3] [0] 3
Product9 [0] [0] [0] 0
Product10 [0] [0] [0] 0
Product11 [0] [0] [0] 0
Product12 [0] [0] [0] 0
23
带 [] 的字段是可编辑的,其他字段会自动计算使用 jQuery。
有人可以帮助我吗?
My question is, how can I create a table with dynamic fields (I will explain this later), and send them values by mail with eform?
In the table, on the left, I want to print all the document children that are using template XX, and on the top, I want the user to specify how much columns he wants (besides the products/documents column) and give a name for them. this is to create a table based shop for buyers that order a lot of products at the same time. If the buyer has 3 clients, he says that he want 3 columns with the "Row1" "Row2" and "Row3" names, so it will be something like this:
Row1 Row2 Row3 Total
Product1 [0] [0] [0] 0
Product2 [0] [0] [0] 0
Product3 [0] [0] [0] 0
Product4 [0] [0] [0] 0
Product5 [0] [0] [0] 0
Product6 [0] [0] [20] 20
Product7 [0] [0] [0] 0
Product8 [0] [3] [0] 3
Product9 [0] [0] [0] 0
Product10 [0] [0] [0] 0
Product11 [0] [0] [0] 0
Product12 [0] [0] [0] 0
23
The fields with [] are editable, and the others are automatically calculated with jQuery.
Can anyone help me?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想您也许可以创建一个电子表单,其中包含一个片段或同上调用来执行此操作。
这个场景有点复杂,我不知道哪一部分是由 modx 完成的,哪一部分是由 jquery 完成的,但是您也可以使用 jquery 完成很多工作。
我的意思是,您可以为每行(产品)创建一个隐藏字段,并推送所选列(行)的逗号分隔数组,jquery 将更新该数组,然后使用 JQ 创建附加字段(行 + 总计),
那么您可以创建一个电子表单,该电子表单内部有一个同上调用,用于调用文档的所有子项并为每个子项创建一个表单字段。
我不确定同上是否可以根据使用的模板选择资源,所以如果不能,您可能需要创建一个片段来遍历文档,或者使用 phx 来检查模板
我意识到这并不完全正确解决问题,但希望能给你一些尝试的东西
I'm thinking you might be able to create an eform that has a snippet or ditto call inside it to do this.
The scenario is a bit complex and I don't get which part is done by modx and which part by jquery, but you could do quite a bit of this with jquery aswell.
what I mean is, that you could create a hidden field for each of the rows(products), and push a comma delimited array of the columns(Row) selected, that jquery would update, and then use JQ to create the additional fields (rows + total)
then you can create an eform that would have a ditto call inside if to call all the children of a document and create a form field for each.
I'm not sure if ditto can select resources based on the template used, so if it cannot, you might need to create a snippet to traverse through the documents, or use phx to check for the template
I realize that this doesn't exactly solve the problem, but hopefully gives you some things to try