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

Pulling and displaying text using the backend services and the kendo UI

2 Answers 100 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paul
Top achievements
Rank 1
Paul asked on 26 Mar 2014, 05:57 PM
Hi,
I am trying to figure how you would allow a person to add content into the "Homepage Content" field in a table in the back end and display on the index.html page of my app? I have looked at some of them sample apps but cant make them out?

Paul

2 Answers, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 27 Mar 2014, 12:30 PM
Hello Paul,

We assume that you want to render a specific HTML into your 'index' page with the hmtl string retrieved from a Backend Services content type. Here is a code snippet that will to this (presuming that the HomePageContent is a field of type "Text" and contains a valid html string).

<div id="container"></div>
<script>
 
    var b = document.getElementById("container");
    var el = new Everlive("your-api-key-here");
 
    var myHtml;
    el.data("Content type name").getById("id of the item", function (data) {
        myHtml = data.result.HomePageContent;
        b.innerHTML = myHtml;
    }, function (err) {
        console.log(JSON.stringify(err));
    })
</script>


Hopefully, the Kendo UI Editor widget and Backend Services JavaScript SDK (along with its dedicated Kendo UI integration) will be helpful in accomplishing more complex scenarios.

Regards,
Anton Dobrev
Telerik
 

Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

 
0
Paul
Top achievements
Rank 1
answered on 28 Mar 2014, 04:39 PM
Nice, I got it to work.

Thank you  ,
Paul
Tags
General Discussion
Asked by
Paul
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Paul
Top achievements
Rank 1
Share this question
or