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

[Solved] initial editor by javascript ?

1 Answer 42 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kevin
Top achievements
Rank 1
Kevin asked on 04 Aug 2011, 04:04 AM
Hi ,

Is there any example that I can initial the editor by javascript?

for example , in ckeditor, $('div').cheditor();

I didn't see this part in document.

Any idea?

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 04 Aug 2011, 07:19 AM
Hello Kevin,

You can initialize the editor using the tEditor() jQuery plugin, like so:

$(".myEditor").tEditor();

However, this won't render the necessary HTML for the editor -- so you need to create it by yourself, i.e.

$('<table cellpadding="0" cellspacing="4" class="t-widget t-editor t-header" id="editor" style="height:400px">' +
'<tr><td class="t-editor-toolbar-wrap">' +
'<ul class="t-editor-toolbar">' +
'<li class="t-editor-button"><a class="t-tool-icon t-bold" href="#">bold</a></li>' +
'<li class="t-editor-button"><a class="t-tool-icon t-italic" href="#">italic</a></li>' +
'<li class="t-editor-button"><a class="t-tool-icon t-createLink" href="#">createLink</a></li>' +
'<li class="t-editor-button"><a class="t-tool-icon t-unlink" href="#">unlink</a></li>' +
'<li class="t-separator"></li>' +
'<li class="t-editor-button"><a class="t-tool-icon t-insertImage" href="#">insertImage</a></li>' +
'</ul></td></tr>' +
'<tr><td class="t-editable-area">' +
'<textarea class="t-content t-raw-content" cols="20" id="editor-value" name="editor" rows="5"></textarea>' +
'</td></tr>'
'</table>').appendTo(document.body).tEditor();

We have the client-side rendering in mind for a future version of the component, and it is logged in the public issue tracking system if you want to bump its priority up.

Kind regards,
Alex Gyoshev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Tags
Editor
Asked by
Kevin
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or