Extra Form

1. 대댓글 버튼

<button cond="$oDocument->allowComment()" class="re_comment" onclick="<!--@if(!$grant->write_comment || !$oDocument->isEnableComment())-->alert('{$lang->msg_not_permitted}')<!--@else-->reComment({$comment->get('document_srl')},{$comment->get('comment_srl')},'{getUrl('act','dispBoardReplyComment','comment_srl',$comment->comment_srl)}')<!--@end-->;return false;">
 대댓글
</button>

먼저 각 댓글마다 대댓글을 호출하는 버튼을 위와 같이 만들었습니다.

reComment(document_srl, comment_srl, edit_url) 이라는 함수를 실행하고 있습니다.

먼저 이 함수는 실행이 잘 됩니다....


2. script

// 대댓글 돔 구조 변경
function reComment(doc_srl,cmt_srl,edit_url){


 var o = jQuery('.comment-form').eq(0);
 o.find('input[name=error_return_url]').val('/'+doc_srl);
 o.find('input[name=mid]').val(current_mid);
 o.find('input[name=act]').val('dispBoardReplyComment');
 o.find('input[name=document_srl]').val(doc_srl);
 o.appendTo(jQuery('#comment_'+cmt_srl)).fadeIn().find('input[name=parent_srl]').val(cmt_srl);
 o.find('a.wysiwyg').attr('href',edit_url);
 o.find('textarea').focus();

 $.getScript('/rx/common/js/plugins/ckeditor/ckeditor/ckeditor.js', function() {
  console.debug('ckeditor.js 로드 성공');
 });

 setTimeout(() => {
  console.log("Delayed for 1 second.");

  $("iframe.cke_wysiwyg_frame.cke_reset").ready(function() {
   var add = "<p><br></p>";
   var body = $("iframe.cke_wysiwyg_frame.cke_reset").contents().find("body");
   body.attr('className','rhymix_content xe_content editable cke_auto_dark_mode cke_editable cke_editable_themed cke_contents_ltr cke_show_borders'); //color_scheme_light
   body.attr('spellCheck','false');
   body.attr('contentEditable','true');
   body.append(add);
  });
 }, "500");
}

3. 글보기+댓글쓰기+댓글리스트

글보기, 댓글쓰기, 댓글리스트가 모두 _read.html에 있습니다.

1) 댓글쓰기

_read.html 에서 댓글을 작성하는 form의 클래스를 comment-form 로 지정해두었습니다.

2의 스크립트가 동작하여 해당 댓글쓰기 폼이 대댓글쓰기 폼으로 각 값이 변경됩니다.

각 값 자체는 정상적으로 변경되고, 원하는 위치에 로드됩니다.

4. 문제는 댓글을 작성하면  '내용 값은 필수입니다.' 라고 뜨고 작성이 안됩니다.

어쩌다 로딩이 잘 될 경우(?) 글작성이 되기도 합니다. 그 때는 파일 첨부도 정상적으로 잘 됩니다.

안될 경우의 문제를 못 찾겠습니다.

추가시작추가끝


질문•답변

상품문의, 포인트관련 문의는 멤버십 지원게시판에 작성해주세요. (프로젝트>기술지원)

  1. 공지사항 notice

    본 게시판의 용도

    Date2024년 06월 11일 Category기타
    read more
  2. XE 라이믹스, XE robots.txt 설정 어떻게 하셨나요?

    Date2022년 11월 30일 CategoryXE
    Read More
  3. XE 내가 쓴글만 모아보는 위젯

    Date2022년 11월 29일 CategoryXE
    Read More
  4. 1. 대댓글 버튼 <button cond="$oDocument->allowComment()" class="re_comment" onclick="<!--@if(!$grant->write_comment || !$oDocument->isEnableComment())-->alert('{$lang->msg_not_permitted}')<!--@else-->reComment({$comment->get('document_srl')}...

    XE 대댓글 페이지 이동 없이 바로 입력

    Date2022년 11월 01일 CategoryXE
    Read More
  5. 비밀글입니다.

    XE 코드직접삽입위젯을 구매했는데요..

    Date2022년 10월 24일 CategoryXE
    Read More
  6. 비밀글입니다.

    XE 애드센스 위젯 문의드립니다.

    Date2022년 10월 19일 CategoryXE
    Read More
  7. XE 누리고 상품관리 썸네일 안 나오는 현상

    Date2022년 09월 30일 CategoryXE
    Read More
  8. 비밀글입니다.

    XE Excel 등록

    Date2022년 09월 29일 CategoryXE
    Read More
  9. 비밀글입니다.

    XE 이온디님 안녕하세요

    Date2022년 09월 16일 CategoryXE
    Read More
  10. 비밀글입니다.

    XE 현재 이온디에서 사용 중이신 레이아웃을 구매할 수 있을까요?

    Date2022년 07월 27일 CategoryXE
    Read More
  11. XE WIKI 모듈 질문 하나만 더 해봅니다.

    Date2022년 07월 05일 CategoryXE
    Read More
  12. 비밀글입니다.

    XE 구매문의

    Date2022년 07월 03일 CategoryXE
    Read More
  13. XE WIKI 문서 수정시 등록버튼이 안먹히는 문제

    Date2022년 07월 02일 CategoryXE
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 14 Next
/ 14
닫기

마이페이지

로그인을 해주세요

네이버로 로그인