Hello,
we are using 8.2.
I am trying to integrate the Ace Editor into smartclient and I am having some issues. Has anyone tried to integrate it before?
http://ace.ajax.org/
Its tagged to a div element and when I try to display it won't draw correctly (seems like it can't determine its size). I have tried overriding getInnerHTML on a canvas and returning the div with the correct id and I can see it does find the element and attaches the editor but the size of the editor is not set.
Simple code that will display the ace editor:
An example of trying to integrate it:
What I see in the debugger is the size of the editor is 0. Anyone have experience with Ace editor or any tips on what I am doing wrong?
Thanks!
we are using 8.2.
I am trying to integrate the Ace Editor into smartclient and I am having some issues. Has anyone tried to integrate it before?
http://ace.ajax.org/
Its tagged to a div element and when I try to display it won't draw correctly (seems like it can't determine its size). I have tried overriding getInnerHTML on a canvas and returning the div with the correct id and I can see it does find the element and attaches the editor but the size of the editor is not set.
Simple code that will display the ace editor:
Code:
<body>
<div id="aceeditor"></div>
<script>
var container = document.getElementById("aceeditor");
var aceeditor = ace.edit("aceeditor");
aceeditor.getSession().setMode("ace/mode/javascript");
aceeditor.getSession().setValue("test code\n");
</script>
</body>
Code:
<body>
<script>
isc.defineClass("DevEditor", "Canvas");
isc.DevEditor.addProperties({
title: "Test",
height: "100%",
width: "100%",
getInnerHTML : function ()
{
return "<div id=\"aceeditor\"></div>";
}
});
var aLayout = isc.VLayout.create({width: "100%", height: "100%"});
var ldev = isc.SamDevEditor.create();
aLayout.addMember(ldev);
isc.Page.setEvent("load", function()
{
var container = document.getElementById("aceeditor");
var aceeditor = ace.edit("aceeditor");
aceeditor.getSession().setMode("ace/mode/javascript");
aceeditor.getSession().setValue("test code\n");
});
aLayout.draw();
</script>
</body>
Thanks!
Comment