如何复制UI字段并再次将其存储在数据库中并检索和显示它们。 [英] How can I duplicate the UI fields and again store it in data base and retrieve and show them.

查看:66
本文介绍了如何复制UI字段并再次将其存储在数据库中并检索和显示它们。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下方案要执行:

1.我创建了一个包含五个文本字段的UI。

2.我将有一个计数增量按钮,如果clicked将再次动态创建另一组具有五个文本字段的UI。多少次我点击计数增量按钮,动态创建多个UI。

3.我再次保存并填充UI,需要将其视为是的。

4.简而言之,创建和保存动态UI的数量必须保存在数据库中并相应地检索和显示。

5.如果是特定任务需要提交一套,它显示为原样。如果对于特定任务,那里有五组UI,如果我们保存,那么还需要显示5组。



需要逻辑,方式要做到这一点,代码片段和示例,如果有相同的情况。

- 如何动态添加重复的UI

- 逻辑保存在数据库中
- 再次显示已保存的UI



提前致谢...



Raghunath

I have following scenario to perform:
1. I have created an UI with five text fields.
2. I will have a count increment button, which if clicked will again dynamically create the another set of UI with five text field. How many times I would click on the count increment button, that many set of the UI to be created dynamically.
3. Again I have to save and fill the UI and it needs to be seen as it was.
4. In short the number of dynamically UI created and saved has to be saved in the database and retrieved and shown accordingly.
5. If for a particular task one set needs to be filed, it is shown as it is. If for a particular tasks, five set of UI is there and if we save as it is then also that 5 set needs to be shown.

Need a logic, way to do it, code snippet and examples if any for the same scenario.
--how to dynamically add duplicate UI
-- logic to save in the database
-- again show the saved UI

Thanks in advance...

Raghunath

推荐答案

1)如何动态添加重复的UI?



- 像 .clone() [ ^ ]会很有用。



2)保存在数据库中的逻辑



- 它应该是你的,因为没有人知道你将如何处理元素。它就像从字段中获取值一样简单,调用web方法并将其存储到DB。



3)再次显示已保存的UI



- 在加载数据时,计算记录数,为它们生成字段并分配值。从这里开始,每当有人点击添加按钮时,第一步就应该开始。



问候......
1) How to dynamically add duplicate UI?

- Some thing like .clone()[^] would be useful.

2) Logic to save in the database

- It should be yours because nobody knows how you are going to process the elements. Its as simple as get values from fields,make a call to web method and store it to DB.

3) Again show the saved UI

- At the time of loading the data, count the number of records, generate fields for them and assign a value. From here, whenever some one clicks add button, step one should start.

Regards...


  1. 要复制,您可以将所有初始控件放在一个 div 中,然后在按钮上单击,只需 clone [ ^ ] div ,这样它就会给你相同数量的元素。
  2. 对于数据库,如果您使用任何服务器端语言,那么您可以使用 jQuery 进行Ajax调用并保存。
  3. 保存后,您必须执行查询或存储过程并获取数据。然后填写适当的控件。
  1. To duplicate, you can put all the initial controls in one div and on that Button click, just clone[^] the div, so that it will give you the same number of elements.
  2. For database, if you are using any Server side language, then you can Ajax call using jQuery and Save.
  3. After saving, you have to execute queries or Stored Procedures and get the data. Then fill the appropriate controls.


这篇关于如何复制UI字段并再次将其存储在数据库中并检索和显示它们。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆