cheditor를 사용한 textarea에 동적 텍스트 할당 방법 정보
cheditor를 사용한 textarea에 동적 텍스트 할당 방법본문
cheditor을 사용하는 textarea에 동적으로 텍스트를 넣고 싶습니다.
$('#tx_wr_content' ).val(inputPrn)이런 형식으로 넣었는데 브라우저상 내용이 보이지 않습니다.
위와 같이 할당하고 $('textarea').val()로 확인해 보면 내용이 들어가 있습니다.
id로는 tx_wr_content, message(cheditor용) 둘다 해봤는데, 안되네요..
방법 아시는 분 답변 부탁드립니다
$('#tx_wr_content' ).val(inputPrn)이런 형식으로 넣었는데 브라우저상 내용이 보이지 않습니다.
위와 같이 할당하고 $('textarea').val()로 확인해 보면 내용이 들어가 있습니다.
id로는 tx_wr_content, message(cheditor용) 둘다 해봤는데, 안되네요..
방법 아시는 분 답변 부탁드립니다
댓글 전체
말씀하신 부분은 cheditor 에디터를 모두 분석해야 답이 나옵니다.
원하시는 답변은 얻기 어려우실듯...
원하시는 답변은 얻기 어려우실듯...
아~ 어렵네요. 구매당시 설명서 찾아봐야겠네요 ㅠㅠ
아님 나창호님께 직접~ ^^;
아님 나창호님께 직접~ ^^;
자답 입니다.
예전에 이런 부분에 대한 질문과 답변이 올라온적 있었네요..
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=153786
이것 말고 불당님?인가 올리신 내용 있는데 동적으로 입력하는게 아닌 것으로 $content 변수에 직접 입력하는 방식도 있었습니다.(링크를 잊어버려서 링크 못해드립니다.)
그누에 포함된 cheditor의 버전에 따라 또한 현재 정식 버전에 따라 스크립트의 함수, 개체 등등이 호환이 안됩니다.
일단 그누 안에서 dhtml를 사용시 상단에 var ed_wr_content = new cheditor('ed_wr_content');라고
선언됩니다.
따라서 동적으로 선언될 스크립트 부분에 ed_wr_content.insertContents(동적 텍스트 변수명);로 입력해 주시고, cheditor.js의 prototype안 적당 위치에 함수 추가해 줍니다.
appendContents : function (contents) {
this.editArea.focus();
contents = this.editArea.document.body.innerHTML + contents;
this.loadContents(contents);
this.editArea.focus();
},
insertContents : function (contents) {
this.editArea.focus();
this.setSelection();
this.doCmdPaste(contents);
},
(4.32.03버전 기준)
추가용 함수인 appendContents는 중간에 개체 없다고 나옵니다. 아마도 해당 스크립트가 다른 버전의 cheditor 스크립트 인 것 같습니다.
insertContents은 잘 작동 합니다.
관련 내용들 링크 입니다. 최근 버전이신 분들은 참조하셔서 수정하시면 될 듯 합니다.
http://www.chcode.com/cgi-bin/forum/showthreaded.pl?Cat=&Board=cheditor_install&Number=2201&Search=true&Forum=cheditor_install&Words=this.editArea&Match=Entire%20Phrase&Searchpage=0&Limit=25&Old=allposts&Main=2201
http://www.chcode.com/cgi-bin/forum/showthreaded.pl?Cat=&Board=cheditor_install&Number=3360&page=&view=&sb=&vc=1#Post3360
개발사 포럼에서 appendContents 등으로 입력하면 해당 글들 나오니 참고하시면 됩니다.
예전에 이런 부분에 대한 질문과 답변이 올라온적 있었네요..
http://sir.co.kr/bbs/board.php?bo_table=g4_qa&wr_id=153786
이것 말고 불당님?인가 올리신 내용 있는데 동적으로 입력하는게 아닌 것으로 $content 변수에 직접 입력하는 방식도 있었습니다.(링크를 잊어버려서 링크 못해드립니다.)
그누에 포함된 cheditor의 버전에 따라 또한 현재 정식 버전에 따라 스크립트의 함수, 개체 등등이 호환이 안됩니다.
일단 그누 안에서 dhtml를 사용시 상단에 var ed_wr_content = new cheditor('ed_wr_content');라고
선언됩니다.
따라서 동적으로 선언될 스크립트 부분에 ed_wr_content.insertContents(동적 텍스트 변수명);로 입력해 주시고, cheditor.js의 prototype안 적당 위치에 함수 추가해 줍니다.
appendContents : function (contents) {
this.editArea.focus();
contents = this.editArea.document.body.innerHTML + contents;
this.loadContents(contents);
this.editArea.focus();
},
insertContents : function (contents) {
this.editArea.focus();
this.setSelection();
this.doCmdPaste(contents);
},
(4.32.03버전 기준)
추가용 함수인 appendContents는 중간에 개체 없다고 나옵니다. 아마도 해당 스크립트가 다른 버전의 cheditor 스크립트 인 것 같습니다.
insertContents은 잘 작동 합니다.
관련 내용들 링크 입니다. 최근 버전이신 분들은 참조하셔서 수정하시면 될 듯 합니다.
http://www.chcode.com/cgi-bin/forum/showthreaded.pl?Cat=&Board=cheditor_install&Number=2201&Search=true&Forum=cheditor_install&Words=this.editArea&Match=Entire%20Phrase&Searchpage=0&Limit=25&Old=allposts&Main=2201
http://www.chcode.com/cgi-bin/forum/showthreaded.pl?Cat=&Board=cheditor_install&Number=3360&page=&view=&sb=&vc=1#Post3360
개발사 포럼에서 appendContents 등으로 입력하면 해당 글들 나오니 참고하시면 됩니다.
감사합니다
thx~