Reputation: 1286
I have problem with dijit.Editor. After removing it's DOM from document and re-appending it, it's value is cleared.
The test for this is in this fiddle: According to commented alerts in example, the value is being cleared after appending. It is still in memory after removing editor.
I tried to add "reloading" code to onLoadDeferred
. But it is not called when reappending editor.
I cannot easily call reload on it by myself, because I am re-appending whole form in my app. I don't know anything about form's contents.
Also, I am quite sure that this is dijit.Editor's issue. I tested reappending javascript generated Iframe (example here) and it is working.
Thanks for any help!
Upvotes: 0
Views: 118
Reputation: 7352
I modified your iframe javascript test so it writes to iframe document only once and it seems to behave the same way the Dijit Editor does.
I think you will have to set value of the Editor every time you placeAt
it, but you do not have to do it manually, you can use one of these:
aspect.after(editor, "placeAt", lang.hitch(editor, function() {
this.set("value", this.get("value"));
}));
var Editor = declare([DijitEditor], {
placeAt: function() {
this.inherited(arguments);
this.set("value", this.get("value"));
}
});
See it in action at jsFiddle: http://jsfiddle.net/phusick/PXZk5/
Upvotes: 1