问题标签 [lightswitch-2012]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
142 浏览

visual-studio-lightswitch - LightSwitch EventHandlers

Developing my first real LightSwitch App.

From the main screen it drills through some hierarchical entities using detail screens until we come to a Browse screen for a particular leaf object (type 'Unit')

The chosen Unit has many date stamped 'Readings'. These readings are summarised by a DataViz chart feeding off a server controller. This all works.

I want to introduce a datetime picker into the mix.

Update the picker and it causes the chart's url property to be updated and requeries the controller.

Result being a new summary display of a new date range of Readings. That's the goal.

I add the DateTimePicker as another custom control and declare its Change Date event handler inside the pre_render code.

The DTP displays OK and its changed date event handler fires correctly.

I expected to do the magic in this handler of referencing the chart's url property and updating it with the new query string then somehow causing the controller to be requeried..

But... I can't reference the chart.

I have seen a post that LS does not expose the ids of its controls even though you declare the 'id' attribute. So possibly I am going about this the wrong way.

I get the feeling there is probably a way to bind the selected date on the dtp to a new property inside the Chart control say ':currentDate' and use this to update the URL and trigger a new call on the controller. Thereby avoiding eventHandlers. (Similar to Googles's Map API MVC implementation)

But I haven't a clue if this is correct or how to go about it.

Could someone please advise the correct way to achieve this goal. I have wandered around inside blogs and posts for many hours but can't see the way forward.

thanks

Bob

0 投票
1 回答
878 浏览

c# - 从 Lightswitch 中的服务器项目访问公共项目中设置的变量

所以我重做了前一个问题的一些代码,但是同样的潜在问题仍然存在。我想要做的是:当我的灯开关应用程序通过Application.cs我启动时,我正在使用一种方法Application_LoggedIn()来调用我的公共项目中的一个函数来获取用户可以访问的所有位置(这些数据存储在一个表中)。

客户项目 - Application.cs

通用项目 - 调用该方法后,我在 members() 函数中运行我的查询以获取用户可以访问的所有位置。它们存储在三个列表中:estimateList、deptList、groupList;

这样做之后我想要的是能够从我的服务器项目内部访问 3 个列表(estate、dept、group),这样我就可以使用该列表对我的实体执行过滤器,如下所示。

这就是我想要做的,我遇到了问题。任何建议都会受到欢迎。我试图做的是在我的公共项目中创建一个静态类并设置值,但是正如一位用户正确指出的那样,我不能这样做,因为当我尝试从我的服务器项目中调用它时它将为空。请在这里帮助我,这是我在使用此应用程序时遇到的一个大问题,并且是唯一剩下的部分。提前致谢。

** * ** * ** * ***服务器端的过滤器代码* @Duran 这是我在服务器端的。

我必须在我的所有表上放置一个类似于上面的过滤器,那就是当我收到 stackoverflow 错误时。它仅在一张桌子上时有效,但在所有桌子上时无效。我究竟做错了什么?

0 投票
1 回答
129 浏览

c# - 使用 Lightswitch 保存时的数据验证

现在我有一张表,我正在输入 spu 日期和发布日期。我想验证在添加新行时,它会在当前表中查看是否有任何其他的 spud 日期,以确保新的 spud 日期晚于前一个 spud,并验证它之前的发布日期它添加了一个新行。有人知道怎么做吗。

我在 validate 函数中有这个代码,但这只是在输入当前项目时。我还需要返回并查看其他记录以进行比较,就像我说的那样。

0 投票
1 回答
158 浏览

c# - 在 Linq 中访问实体查询——Lightswitch 应用程序

我正在使用电灯开关。现在我有一个实体名称:Jobs,该实体“Jobs”有一个查询项目名称 Query1。现在我想使用 linq 访问 Query1。

那是对实体 Jobs 的 linq 查询。我想在 Query1 上进行 linq 查询。我不知道。帮我。

0 投票
2 回答
1788 浏览

c# - Lightswitch 将所有行导出到 CSV

我在 lightswitch web 应用程序上使用 c# 和 VS2012,

我希望将我的数据导出为 CSV(在搜索屏幕上!),但无法访问任何 POC,

据我了解,有两个主要问题 - savefiledialog 必须直接由用户按钮引起,并且必须在主调度程序中发生,

我使用了这段代码:

这可行,但它只能让我获得第一页项目,在另一件事上我必须做我通过使用此代码解决了这个问题:

然而,尝试而不是仅仅使用“MySearch”会给我以下错误:

为什么在处理数据的系统构建上做这样一个与数据相关的基本事情(导出到 csv/excel)如此困难?

有任何想法吗 ?

0 投票
1 回答
2600 浏览

javascript - 无法在 LightSwitch HTML 中使用 Syncfusion JavaScript 组件

我刚刚以 599 美元的价格购买了 SyncFusion Essential Studio Enterprise。我使用他们的 LightSwitch Silverlight 组件没有问题,但在使用 JavaScript 组件时似乎遇到了一些奇怪的问题。

这是来自全新(完全为空)LightSwitch HTML 客户端的 default.htm 文件的所有内容,其中包含 SyncFusion 所需的修改:

在 IE11/10 中,我收到以下错误消息:“无法加载模型:错误:堆栈空间不足”

在 Chrome 中,我收到类似的消息:“无法加载模型:RangeError:超出最大调用堆栈大小”

在 FireFox 中,我也收到了类似的消息:“无法加载模型:InternalError: too much recursion”

错误表明它可能是一个组件尝试多次注册或其他什么,我的问题是为什么以及如何解决这个问题?

当然,这在标准 HTML 页面上可以正常工作(我正在查看提供的示例)......只是 LightSwitch 存在问题。

编辑 以下是我从 Syncfusion 收到的回复。如前所述,这没有任何影响:

开始电子邮件

感谢您使用 Syncfusion 产品。

我们能够重现上述报告的问题,并且我们分析该问题是由于 msls-2.0.0.js 中的数组迭代不正确以及在 ej.widget.all.js 中查找 lastItem 的不需要的 Array 原型函数添加造成的。为了克服这个问题,我们准备了以下工作。

代码片段:

我们已确认这是一个缺陷,并为此记录了一个缺陷报告。我们建议您遵循上述解决方法,直到该缺陷在我们即将发布的主版本 [2014 Vol-1] 中可用,该版本预计将于 3 月底发布。我们感谢您在此之前的宝贵耐心。

如果您需要进一步的帮助,请与我们联系。

感谢和问候,

结束电子邮件

0 投票
1 回答
1194 浏览

html - 如何在 HTML5 Lightswitch 客户端中检测添加或编辑模式?

在使用 LightSwitch 时,如何检测详细信息页面是否处于添加或编辑模式?

我想将屏幕标题从 AddEdit Customer 更改为“Add Customer”或“Edit Customer”。

我可以得到 screen.detail.dispayName = "Something"。我需要知道如何检测它是否处于添加或编辑模式。

0 投票
1 回答
455 浏览

visual-studio-lightswitch - How to add a lightswitch property based on related table custom query?

This is probably a simple solution but I am just trying out LightSwitch for the first time. The problem that I am running into is that I have a table called Job that needs 2 employees tied to it. There are 2 types of employees, Operators and Auditors defined in the EmployeeTypes Table. In my Jobs table I am trying to add the related table employees twice and have it only accept the certain type of employee. I hope this makes sense, to clarify I have added a screenshot of how it is working now, and how I want it to work.

How would I go about doing this? The only way I know how to do it at the moment through lightswitch is to create a table for each employee type, but this seems counter-productive and a bad way to design the database because the only difference in each employee type is the employeetype itself. Please let me know if you have any ideas on how this would work.

Screenshot

0 投票
2 回答
650 浏览

c# - 在 Light Switch 中使用存储过程

我想用电灯开关实现一个场景。场景如下:

1-使用 2 个输入参数在 sql server 中创建一个存储过程

2-创建一个带有灯开关的表单,为 sp 提供这两个输入参数

3-用我的表单中的按钮将这两个参数发送到我的 sp

4- 在 sql server 上运行 sp。这个 sp 从 db 返回一个记录列表

5-在网格中显示从 sp 返回的列表

可能吗?如果是,我们如何做这项工作?

0 投票
1 回答
427 浏览

visual-studio-2012 - 为“所有用户”安装 LightSwitch 2 层应用程序?

我为客户开发了一个 LightSwitch 2 层应用程序(桌面应用程序)。客户端现在想要在 Citrix 服务器上安装应用程序,因此该应用程序必须可供服务器上的所有用户使用。

不幸的是,当从 Visual Studio 2012 发布桌面 LightSwitch 应用程序时,输出的安装可执行文件没有安装“仅适用于我”或“适用于所有用户”的通常选项。甚至无法指定安装目的地,LightSwitch 应用程序始终安装到当前用户的配置文件中,使其对其他用户不可用。不能为每个用户安装一次应用程序。

有没有办法简单地选择以一种让服务器的所有用户都可以访问的方式部署 LightSwitch 应用程序?

我知道可以将 LightSwitch 应用程序部署为 3 层 Web 应用程序,但这在我的客户情况下并不理想。