Telerik RadEditor의 HTML을 Javascript로 수동으로 정리하려고하지만 값을 저장할 정확한 위치를 찾을 수 없어 저장되지 않습니다. 다시 게시하십시오.Telerik RadEditor의 값을 Javascript/jQuery로 변경하십시오.
$(function() {
jQuery.fixHash = function ($html) {
// modify $html
return $html;
};
$("#adminEditingArea input[id$='SaveButton']").unbind("click").click(function() {
$("iframe[id$='_contentIframe']").trigger("save");
// call .net postback
return false;
});
});
var editorSaveEventInit = false;
function InitSaveEvent() {
if (!editorSaveEventInit) {
var $EditFrames = $("iframe[id$='_contentIframe']");
if ($EditFrames && $EditFrames.length > 0) {
$EditFrames.bind("save", function (e) {
var $thisFrame = $(this);
var thisFrameContents = $thisFrame.contents();
if (thisFrameContents) {
var telerikContentIFrame = thisFrameContents.get(0);
var $body = $("body", telerikContentIFrame);
var html = $.fixHash($body).html();
$body.html(html);
// also tried storing the modified HTML in the textarea, but it doesn't seem to save:
//$thisFrame.prev("textarea").html(encodeURIComponent("<body>" + html + "</body>"));
}
});
editorSaveEventInit = true;
}
}
};
$(window).load(function() {
InitSaveEvent();
});
자바 스크립트와 Telerik의 RadEditor 개체에 액세스 할 수있는 방법은 (? OnClientCommandExecuted()
사용) 나는 .get_html()
및 .set_html(value)
기능에 액세스 할 수 있도록 있는가 :
여기에 내가 가지고있는 JS입니까? 그렇지 않은 경우 게시하기 전에 어떤 값을 설정해야합니까?
신난다. 나는 심지어 그것들이 가능하다는 것을 몰랐다. 내 현재 솔루션을 리팩토링하는 데 약간 늦은 것 같지만, 앞으로는 유용 할 것입니다. 감사합니다! – travis