级联选择列表 [英] Cascading Pick Lists

查看:113
本文介绍了级联选择列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Cascading DropDown列表有一点问题,我希望它只是那个 我不明白Lightswitch的概念,或者我错误地设计了数据库,以便LightSwitch有效使用。


我有4张桌子。


1 - 部门,2 - 子部门,3 - 教师,4 - TeacherstoDepartmentsMapping(pkid,departmentid,teacherid)


我有1个屏幕,您首先选择部门,然后第二个DDL填充所选部门的所有子部门。有一个很棒的帖子,我的工作正常。 ( http://blogs.msdn.com/b/lightswitch/archive/2010/11/15/how-to-use-lookup-tables-with-parameterized-queries-karol-zadora-przylecki.aspx


我无法工作的是第三个DDL,它应该显示所有教授所选部门的教师。我在Mapping表中创建了一个关系到教师表的关系。该工作正常。


我试图完成这两种方式,但似乎都不起作用:


1)我在映射表上创建了一个查询,但是当我将查询添加到屏幕并将参数映射到屏幕时,它没有显示为"选择"。对于教师下拉列表。 (我假设这是因为查询引用的基表是不同的?)


2)我在教师表上创建了一个查询,但是我没有看到任何对该表的引用映射表在查询屏幕的过滤器部分,所以我无法创建参数化过滤器。我想也许我可以使用"预处理查询"引用不在过滤器列表中的字段
,但我不知道它是如何工作的。


我希望这是有意义的


<非常感谢你的帮助!


Scott

解决方案

嗨  Scott


问题:教师可以在多个子部门吗?


 


Jaime


I'm having a little problem with Cascading DropDown lists and I'm hoping it's just that I don't understand the concepts of Lightswitch or I've designed the DB incorrectly for LightSwitch to use effectively.

I have 4 tables.

1 - Departments, 2 - SubDepartments, 3 - Teachers, 4 - TeacherstoDepartmentsMapping(pkid, departmentid, teacherid)

I have 1 screen where you select the department first, then the second DDL populates with all the subdepartments that are a part of the selected department. I have that working fine thanks to a great post. (http://blogs.msdn.com/b/lightswitch/archive/2010/11/15/how-to-use-lookup-tables-with-parameterized-queries-karol-zadora-przylecki.aspx)

What I can't get working is the 3rd DDL which should show all the teachers that teach for the selected department. I created a relationship in the Mapping table to the teachers table which works fine.

I tried to accomplish this 2 ways, but neither seem to work:

1) I created a query on the mapping table, but when I add the query to the screen, and map the parameter to the screen, it doesn't show as a "Choice" for the Teacher drop down list. (I assume this is becuase the base table referenced by the query is different?)

2) I created a query on the teachers table, but I don't see any reference to the mapping table in filter section of the Query screen, so I can't create a parameterized filter. I was thinking maybe I could use "Preprocess Query" to reference fields that aren't in the filter list, but I have no idea how that works.

I hope that makes sense

Thank you very much for your help!

Scott

解决方案

Hi Scott

Question: can a teacher be in more than one sub-department?

 

Jaime


这篇关于级联选择列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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