SheildUI 网格 SaveToExcel 代理,什么是 SaveData?

SheildUI Grid SaveToExcel proxy, What is SaveData?

在您的 MVC SaveToExcel 代理代码中:

public HttpResponseMessage Save([FromBody] SaveData saveData)
{
    var data = Convert.FromBase64String(saveData.Base64Content);
    var contentType = saveData.ContentType;

    // strip the content encoding and other additional headers from the type
    contentType = Regex.Replace(contentType, ";.*$", "", RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnoreCase);

    var result = new HttpResponseMessage(HttpStatusCode.OK)
    {
        Content = new StreamContent(new MemoryStream(data))
    };

    result.Content.Headers.ContentType = new MediaTypeHeaderValue(contentType);
    if (contentType.Contains("xml"))
    {
        result.Content.Headers.ContentType.CharSet = "UTF-8";
    }

    result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
    {
        FileName = saveData.FileName
    };

    return result;
}

我可以在哪个程序集中找到 TYPE SaveData?我在 MSDN 上找不到对它的引用,这是针对 javascript 库的使用,我没有使用 ShieldUI Grid 控件的 MVC 版本。

如果您也用答案更新文档,那将会很有帮助。

展示如何将其与远程数据绑定一起使用可能是个好主意。

似乎 SaveData 是输入的模型 class,从浏览器发送到文件保护程序。

今天早些时候通知 Shield UI 维护开发人员后,我刚刚看到他们更新了 their documentation 以包含完整的源代码。