Click here to Skip to main content
15,897,273 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

JavaScript
<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>
Posted
Comments
RedDk 18-Feb-16 13:16pm    
Check out some of these:
http://www.codeproject.com/search.aspx?q=cleditor&sbo=qa&usfc=false&x=5&y=6

And if push comes to shove try using some other tool like Visual Studio or Extendscript Toolkit.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900