-
FEATURED COMPONENTS
First time here? Check out the FAQ!
can any one please tell me how to intigrate codemirror with zk textbox, i am using codemirror fromTextArea, and passing zk textbox component html textarea, the communication between codemirror and zk textbox is not hapenning. the code i entered in codemirror editor is not passing to zk textbox.
The code below works well for me
<?script type="text/javascript" src="resource/codemirror/lib/codemirror.js"?>
<?style href="resource/codemirror/lib/codemirror.css" type="text/css" ?>
<?script type="text/javascript" src="resource/codemirror/mode/javascript/javascript.js"?>
<zk xmlns:w="client">
<window title="ZK Codemirror Test" border="normal">
<div width="300px" height="250px" style="overflow: hidden;">
<textbox id="tbx" rows="10">
<attribute w:name="bind_"><![CDATA[
function (a, b, c) {
this.$bind_(a, b, c);
var wgt = this;
myCodeMirror = CodeMirror.fromTextArea(this.$n());
myCodeMirror.on('blur', function () {
var val = myCodeMirror.getValue();
wgt.$n().value = val;
wgt.fire('onChange', {value: val}, {toServer: true});
});
}
]]></attribute>
</textbox>
</div>
<button label="test" onClick="alert(tbx.getValue());" />
</window>
</zk>
Asked: 2013-02-19 17:42:04 +0800
Seen: 43 times
Last updated: Nov 14 '15