无法从数据库中设置cleditor的值 [英] Not able to set value on cleditor from database

查看:56
本文介绍了无法从数据库中设置cleditor的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨所有



我有一些来自数据库的数据,我无法将该数据设置为cleditor,cleditor处于非可编辑模式,显示值已为true



我的尝试:



<脚本> 
$( document )。ready( function (){

$( a.modelforstyles)。colorbox({width: 400px,height: 350px});
调试器;

var hiddenDiv3 = document .getElementById( paragraphSec );
var UList = {' subcategoryId' 163 ' categoryId' 163 };

var test = document .getElementById(' Catdetails')。value;

var str = test;
{
// 常量
var FOLDER = $ .cleditor.imagesPath(),
STRIP = icon_dropdown2
EXT = 。gif
URL = URL( + FOLDER + STRIP + EXT +
BUTTON_COUNT = 12
BUTTON_WIDTH = 20
BUTTON_HEIGHT = 20 ;

$ .cleditor.buttons.drop = {
name: drop
css:{
backgroundImage:URL,
backgroundPosition: 4px 5px
backgroundRepeat: no-repeat
},

title: 插入下拉值
命令: inserthtml
popupName: DropDown
popupCla ss: cleditorPrompt
popupContent:str,
buttonClick:drop
}; $ .cleditor.defaultOptions.controls = $ .cleditor.defaultOptions.controls.replace( cut drop | cut);
function drop(drop,i){

$(i.popup).children( :button)。unbind( click)。bind( click function (){

var r = i.editor,u = $(i.popup ).find( select),f = u [ 0 ]。options [u [ 0 ]。selectedIndex] .text,t;
t = { + f + };
r.execCommand(i.command,t, null null ); r.hidePopups(); r.focus()
})
}


$( #ParagraphTextarea)。cleditor()[ 0 ]。refresh();


$( #ParagraphTextarea)。cleditor( );


}




});

< / script>

< textarea id = ParagraphTextarea name = body rows = cols = > @ ViewBag.Details < / textarea >

解决方案

document )。ready( function (){


a.modelforstyles)。colorbox({width: 400px,height: 350px});
debugger ;

var hiddenDiv3 = document .getElementById( paragraphSec);
var UList = {' subcategoryId' 163 ' categoryId' 163 };

var test = document .getElementById(' Catdetails')。value;

var str = test;
{
// 常量
var FOLDER =


.cleditor.imagesPath(),
STRIP = icon_dropdown2
EXT = 。gif
网址= 网址( + FOLDER + STRIP + EXT +
BUTTON_COUNT = 12
BUTTON_WIDTH = 20
BUTTON_HEIGHT = 20 ;

hi all

I have some data from database ,i am not able to set that data into cleditor,cleditor is in non editable mode showing value has "true"

What I have tried:

<script>
        $(document).ready(function () {
          
            $("a.modelforstyles").colorbox({ width: "400px", height: "350px" });
            debugger;
          
            var hiddenDiv3 = document.getElementById("paragraphSec");
            var UList = { 'subcategoryId': 163, 'categoryId': 163 };
           
            var test = document.getElementById('Catdetails').value;
          
            var str = test;
                     {
                        // Constants
                        var FOLDER = $.cleditor.imagesPath(),
                            STRIP = "icon_dropdown2",
                            EXT = ".gif",
                            URL = "URL(" + FOLDER + STRIP + EXT + ")",
                            BUTTON_COUNT = 12,
                            BUTTON_WIDTH = 20,
                            BUTTON_HEIGHT = 20;

                        $.cleditor.buttons.drop = {
                            name: "drop",
                            css: {
                                backgroundImage: URL,
                                backgroundPosition: "4px 5px",
                                backgroundRepeat: "no-repeat"
                            },

                            title: "Insert Dropdown Value",
                            command: "inserthtml",
                            popupName: "DropDown",
                            popupClass: "cleditorPrompt",
                            popupContent: str,
                            buttonClick: drop
                        }; $.cleditor.defaultOptions.controls = $.cleditor.defaultOptions.controls.replace("cut", "drop | cut ");
                        function drop(drop, i) {

                            $(i.popup).children(":button").unbind("click").bind("click", function () {

                                var r = i.editor, u = $(i.popup).find("select"), f = u[0].options[u[0].selectedIndex].text, t;
                                t = "{" + f + "}";
                                r.execCommand(i.command, t, null, null); r.hidePopups(); r.focus()
                            })
                        }
                       
                       
                         $("#ParagraphTextarea").cleditor()[0].refresh();
                      
                    
                        $("#ParagraphTextarea").cleditor();

                     
                    }
           
           
        

        });

 </script>

<textarea  id="ParagraphTextarea" name="body"  rows="" cols="">@ViewBag.Details</textarea>

解决方案

(document).ready(function () {


("a.modelforstyles").colorbox({ width: "400px", height: "350px" }); debugger; var hiddenDiv3 = document.getElementById("paragraphSec"); var UList = { 'subcategoryId': 163, 'categoryId': 163 }; var test = document.getElementById('Catdetails').value; var str = test; { // Constants var FOLDER =


.cleditor.imagesPath(), STRIP = "icon_dropdown2", EXT = ".gif", URL = "URL(" + FOLDER + STRIP + EXT + ")", BUTTON_COUNT = 12, BUTTON_WIDTH = 20, BUTTON_HEIGHT = 20;


这篇关于无法从数据库中设置cleditor的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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