添加jQuery的下拉菜单,以一个可变长度的数据条目页面 [英] Adding jQuery Drop Downs to a Variable Length Data Entry Page

查看:131
本文介绍了添加jQuery的下拉菜单,以一个可变长度的数据条目页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我创建条目的形式,可以让一个人多天添加到一个请求。每个请求可以附加1天或以上,每天有几个选择,使他们可以提交表单前。我使用的是这里介绍的方法来做到这一点。

Hey all, I am creating an entry form that allows a person to add multiple days to a request. Each request can have 1 or more days attached and each day has a few selections to make before they can submit the form. I am using the method described here to accomplish this.

现在,我要开始做一些更高级的用户界面功能,如使用JSON数据源建立我的下拉了父子关系列表。我还是挺新的Web开发(从IBM未来我的绿屏的发展),所以我仍然通过实例和教程的学习。我发现亲子下拉菜单的例子很多时,只有一组,但我需要这为任意数量的行和已在页面上添加的同时能够显示正确的选择的值的新行工作每一行,当编辑页面加载。顶部这一关,我想,当某些选项,就透露了一些新的领域。

Now, I want to start doing some more advanced UI features like using a JSON data source to build my drop down lists with a parent-child relationship. I am still quite new web development (coming from IBM i green-screen development) so I am still learning by examples and with tutorials. I have found many examples of parent-child drop downs when there is only one set, but I need this to work for any number of rows and for all new rows that have been added on the page while being able to display the correct selected value for each row when the edit page loads. To top this off, I want, when certain selections are made, to reveal some new fields.

下面是我到目前为止有:

Here is what I have so far:

(此屏幕截图是基于担心的不是最终的功能和刚开始它的工作。孩子下拉目前显示的一切。)

(This is screen shot is based on not worrying about the end features and just getting it working. The child drop down currently shows everything.)

请求类型选择你想利用休假的类型。使用时间变型的基础上订立请求类型什么的清单。当点击添加节我与上面得到它在新行工作的问题说。然后该挑战是要显示/隐藏基于所述请求类型的第二行。如果一个人选择有病 - 员工疾病,疾病的性质应该显示,如果他们选择另一个选项,显示它与疾病关系的两个性质。如果他们选择度假,他们不应该看到的要么领域。

Request Type selects the type of leave you want to take. Use Hours Type gets a list based on what is entered into Request Type. The problem I have with the above is getting it to work on new rows added when clicking "Add Day". The challenge then is to show/hide the second row based on the Request Type. If a person selects Sick - Employee Illness, Nature of Illness should show, if they select another option, it show both Nature of Illness and Relationship. If they select Vacation, they shouldn't see either field.

我JSON设置这些列表。我包括定义什么获取显示了该选项的字段。

I have JSON setup for these lists. I included the fields that define what gets shown for which option.

[{"Id":11,"Title":"Employee Illness","ParentId":10,"MapToCode":"02","HasRelationship":false,"HasNatureOfIllness":true,"ChildRequired":false,"Notes":"","AccrualCode":"S"},
{"Id":1,"Title":"Vacation","ParentId":0,"MapToCode":"04","HasRelationship":false,"HasNatureOfIllness":false,"ChildRequired":false,"Notes":"","AccrualCode":"VAC"}]

我知道这是很多新手的学习和弄清楚。有没有人这样做是愿意分享或知道一个教程,甚至可以点我在正确的方向? (即使是正确的术语)我搜索这个已经失败迄今。

I know this is a lot for a newbie to learn and figure out. Has anyone done this that is willing to share or know of a tutorial or even can point me in the right direction? (Even the proper terminology) My searches for on this has been a failure thus far.

推荐答案

我有一个解决方案的开始在位于<一个href=\"http://stackoverflow.com/questions/4411252/using-jquery-live-to-populate-a-dropdown-and-selecting-an-item\">this问题。

I have a start of a solution over at this question.

这篇关于添加jQuery的下拉菜单,以一个可变长度的数据条目页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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