[英]Get the value of Rich Text Editor in Umbraco backoffice
I've defined a property that is called Reply
and the document type is RichTextEditor
. 我定义了一个名为Reply
的属性,文档类型为RichTextEditor
。
I cannot get the value of Reply
. 我无法获得Reply
的价值。 This problem is only for properties that type of it is RichTextEditor
!!! 此问题仅适用于类型为RichTextEditor
属性!
How can I get the value of Rich Text Editor in Umbraco backoffice? 如何在Umbraco后台获得Rich Text Editor的价值?
I've used Umbraco 7.x
and ASP.NET MVC
. 我使用过Umbraco 7.x
和ASP.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:
}
);
}
});
For getting the value of Reply
, you can use this code. 为了获得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.