Skip to main content

JMaki Dojo Editor

1 reply [Last post]
fralook
Offline
Joined: 2008-11-19

How can I set a variable to the value of a JMaki Dojo Editor. I know how to set the default value, but I want the widget to load with the value of a variable, like a value of a DB.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tduffy50
Offline
Joined: 2007-05-10

I've used this for file-based apps:

var fileName = '';
function getFile(theFile){
dojo.xhrGet( {
url: theFile + '?randomizer=' + parseInt(Math.random()*50505050), //trick browser cache
handleAs: "text",
timeout: 5000,
load: function(response, ioArgs) {
dijit.byId('theEditor').setValue(response);
return response;
},
error: function(response, ioArgs) {
alert("HTTP status code: ", ioArgs.xhr.status);
return response;
}
});
fileName = theFile;
}

I usually call it from a click event on a Tree widget - but it can be done onLoad() as well.