@Html.EJS().RichTextEditor("default").Format((object)ViewBag.types).ActionBegin("onBegin").Render()
<script>
function onBegin(e) {
alert(e.element.textContent + " is Selected");
}
</script> |
public ActionResult Index()
{
object format1 = new
{
text = "Paragraph",
value = "P"
};
object format2 = new
{
text = "My Paragraph",
value = "BlockQuote"
};
object format3 = new
{
text = "Heading 1",
value = "H1"
};
object format4 = new
{
text = "Heading 2",
value = "H2"
};
ViewBag.types = new
{
width = "40px",
types = new[] { format1, format2, format3, format4 }
};
return View();
} |
|