簡體   English   中英

獲取Umbraco后台的Rich Text Editor的價值

[英]Get the value of Rich Text Editor in Umbraco backoffice

我定義了一個名為Reply的屬性,文檔類型為RichTextEditor

我無法獲得Reply的價值。 此問題僅適用於類型為RichTextEditor屬性!

如何在Umbraco后台獲得Rich Text Editor的價值?

我使用過Umbraco 7.xASP.NET MVC

angular.module("umbraco").controller("Reply.controller", function ($scope, $http, $routeParams) {
    $scope.SendReply = function () {
        var contentId = $routeParams.id;
        var replyText = $("#Reply").val(); // without value ??? (type of Reply is RichTextEditor)
        var email = $("#Email").val();     // It's OK.
        var dataObj = {
            ReplyText: replyText,
            ContentId: contentId,
            Email: email,
        };
        $http.post("backoffice/Reply/ReplyToIncomingCall/ReplyMessage", dataObj).then
        (
            function (response) {
                alert("YES!");
                //TODO: 
            }
        );
    }
});

為了獲得Reply的值,您可以使用此代碼。

var replyList = $("[id*='Reply']");

        for (i = 0; i < replyList.length; ++i) {
            var rText = replyList[i].value;
            if (!(rText === "" || rText === null)) {
                replyText = rText;
            }
        }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM