This is a migrated thread and some comments may be shown as answers.

Editor-Custom Tools-View Html

2 Answers 218 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Rodrigo
Top achievements
Rank 1
Rodrigo asked on 01 Aug 2012, 06:44 PM
My problem, as the title says, is with the ViewHTML when saving or make update in the database, for example I have the following html:

<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script src="jquery-1.7.1.js"></script>
    <script src="source/kendo.all.js"></script>
    <link href="styles/kendo.common.css" rel="stylesheet" />
    <link href="styles/kendo.default.css" rel="stylesheet" />
</head>
<body>
    
        <div id="example" class="k-content">
            <div class="configuration k-widget k-header">
                <span class="infoHead">Information</span>
                <p>
                    Open the DropDownList to see the customized appearance of the items.
                </p>
            </div>


            <input id="titles"/>


            <script>
                $(document).ready(function() {
                    $("#titles").kendoDropDownList({
                        dataTextField: "Name",
                        dataValueField: "Id",
                        // define custom template
                        template: '<img src="${ data.BoxArt.SmallUrl }" alt="${ data.Name }" />' +
                                  '<dl>' +
                                      '<dt>Title:</dt><dd>${ data.Name }</dd>' +
                                      '<dt>Year:</dt><dd>${ data.ReleaseYear }</dd>' +
                                  '</dl>',
                        dataSource: {
                            type: "odata",
                            serverFiltering: true,
                            filter: [{
                                field: "Name",
                                operator: "contains",
                                value: "Star Wars"
                            },{
                                field: "BoxArt.SmallUrl",
                                operator: "neq",
                                value: null
                            }],
                            transport: {
                                read: "http://odata.netflix.com/Catalog/Titles"
                            }
                        }
                    });


                    var dropdownlist = $("#titles").data("kendoDropDownList");


                    // set width of the drop-down list
                    dropdownlist.list.width(400);
                });
            </script>


            <style scoped>
                #titles-list .k-item {
                    overflow: hidden; /* clear floated images */
                }


                #titles-list img {
                    box-shadow: 0 0 4px rgba(255,255,255,.7);
                    float: left;
                    margin: 5px;
                }


                #titles-list dl {
                    margin-left: 85px;
                }


                #titles-list dt,
                #titles-list dd {
                    margin: 0;
                    padding: 0;
                }


                #titles-list dt {
                    font-weight: bold;
                    padding-top: .5em;
                }


                #titles-list dd {
                    padding-bottom: .3em;
                }
            </style>
        </div>




</body>
</html>


not save these tags
<! DOCTYPE html>
<html>
<head>


</ head>
<body>


</ body>
</ html>


is there any solution?

2 Answers, 1 is accepted

Sort by
0
Scott
Top achievements
Rank 1
answered on 15 Feb 2013, 07:44 PM
Was a solution ever found for this?  I am facing a very similar problem.

-Scott
0
Dimo
Telerik team
answered on 19 Feb 2013, 11:13 AM
Hello,

The Editor does not accept or submit full page HTML and there are two reasons for this:

1. The Editor's editable area is an iframe element with its own <head> and <body> elements, which have some specific and required content or attributes.

2. The Editor provides the ability to edit visible HTML content. A page <head> section does not contain any visible content, so there is no use in inserting it inside the Editor.

If you need to store and use full page HTML markup, then I suggest you to send only the <body> content to the Editor (without the <body> tag itself) and then add it back to the full page on the server, e.g. before saving to the database.

Greetings,
Dimo
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Editor
Asked by
Rodrigo
Top achievements
Rank 1
Answers by
Scott
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or