Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Work Tasks

richtextbox​.js

  • Last UpdatedMar 12, 2021
  • 1 minute read

// Knockout custom binding for Kendo editor

// Supports Height, Width and Read-Only behaviour.

ko.bindingHandlers.richTextBoxReadOnly = {

update: function (element, valueAccessor)

{

var value = ko.utils.unwrapObservable(valueAccessor());

var editorBody = $(element).parent().find("iframe")[0].contentDocument.body;

$(editorBody).attr("contenteditable", value);

if (value === true)

{

$(element).parent().parent().parent().find(".k-editor-toolbar").show();

}

else

{

$(element).parent().parent().parent().find(".k-editor-toolbar").hide();

}

}

};

ko.bindingHandlers.richTextBoxHeight = {

update: function (element, valueAccessor)

{

var value = ko.utils.unwrapObservable(valueAccessor());

if (value > 0)

{

$(element).parent().parent().parent().find(".k-content").css("height", value + "px");

$(element).parent().parent().parent().parent().parent().find(".k-editor").css("height", value + "px");

}

}

};

ko.bindingHandlers.richTextBoxWidth = {

update: function (element, valueAccessor)

{

var value = ko.utils.unwrapObservable(valueAccessor());

if (value > 0)

{

$(element).parent().parent().parent().parent().parent().find(".k-editor").css("width", value + "px");

}

}

};

TitleResults for “How to create a CRG?”Also Available in