YUI2リッチテキストエディタをプリロードされたテキストでレンダリングしたい。ただし、カーソルは常にテキストの最初の位置にあります。テキストの最後に設定するにはどうすればよいですか?
ありがとう
私は YUI3 を使用していますが、これは YUI2 でも機能する可能性があります。execCommand('insertandfocus','content')エディターをコンテンツで初期化するのではなく、コンテンツを追加しています。
たとえば、これの代わりに:
YUI().use('editor', function(Y) {
var yuiEditor = new Y.EditorBase({
content: myPreloadedContent
});
...
yuiEditor.on('frame:ready', function() {
this.focus();
});
...
});
私はこのようなコンテンツを挿入しています:
YUI().use('editor', function(Y) {
var yuiEditor = new Y.EditorBase();
...
yuiEditor.on('frame:ready', function() {
this.focus(function(){
yuiEditor.execCommand('insertandfocus', myPreloadedContent);
});
});
...
});