Learn how to utilize tinyMCE custom binding using.
public sealed class CabinetShapeEditModel
{
public string Description { get; set; }
}
When implementing in the view:
<script type="text/javascript">
var jso = @Html.Raw(Json.Encode(Model));
var viewModel = ko.mapping.fromJS(jso);
</script>
The HTML structure:
<div style="min-height: 250px; padding-left: 10px; padding-top: 5px;">
<textarea data-bind="wysiwyg: Description, wysiwygConfig: {selector:selector, menubar:false, statusbar : false, height: 210, toolbar: 'undo redo | styleselect | bold italic | link unlink | image | media | charmap| code | table | ltr rtl | emoticons | forecolor backcolor | fullscreen | preview', plugins: 'hr,link,image,charmap,preview,code,fullscreen,insertdatetime,media,table,directionality,emoticons,textcolor' }"></textarea>
</div><script type="text/javascript">
ko.applyBindings(viewModel);</script>
For JavaScript implementation, refer to: https://github.com/michaelpapworth/tinymce-knockout-binding
If encountering the following error: Uncaught TypeError: Unable to process binding "wysiwyg: function (){return Description }" Message: Object [object Object] has no method 'tinymce'
What could have been incorrectly executed?