Lightswitch html客户端覆盖默认保存按钮 [英] Lightswitch html client override default save button

查看:109
本文介绍了Lightswitch html客户端覆盖默认保存按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够覆盖html客户端上的默认保存按钮,但我似乎无法找到控制。我想在它后面写一些验证,并允许用户选择一个选项,但我似乎无法找到它。

I want to be able to override the default save button on the html client however i cant seem to find the control to do so. I want to write some validation behind it and allow the user to select an option but I just cant seem to find it.

我知道Silverlight客户端可以覆盖它,但只是似乎无法在HTML客户端覆盖它。

I know the silverlight client you can override it but just cant seem to override it in the html client.

感谢

thanks

推荐答案

这是使用beforeApplyChanges实现的。

It's achieved using beforeApplyChanges.

例子:(请原谅任何输入错误/语法错误,你会得到大概的想法!)

example: (Please excuse any typos/syntax errors, you get the rough idea!)

myapp.AddEditScreen.beforeApplyChanges = function (screen) {
    switch (screen.Property_SavingStatus) {
    case 'Not Saving':
        setTimeout(function () {
            // Override Save -> toggle SavingStatus -> Call Save again
            SaveMyChangesMyWay();
            screen.Property_SavingStatus = 'Commit';
            myapp.commitChanges(); // Or Discard or Apply.
        }, 500);
        return false; // Cancel save changes request
        break;
    case 'Apply':
        return true;
        break;
    default:
};

这篇关于Lightswitch html客户端覆盖默认保存按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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