2017-02-21 1 views
0

에 열린 두 번째 탭은 내가 두 개의 탭 CKEDITOR 대화 가지고있다 -보기 하나 - 보기 I는 사용자가 클릭 한 경우도 두 가지를 열어야합니다 버튼을 전망 한 내부 두CKEDITOR 대화 버튼 클릭

.

enter image description here

그러나 나는이 작업을 수행하는 방법을 모르겠어요. 이것은 내 CKEDITOR.dialog 코드입니다.

CKEDITOR.dialog.add('placeholder', function(editor) { 
    var lang = editor.lang.placeholder, 
     generalLabel = editor.lang.common.generalTab, 
     validNameRegex = /^[^\[\]<>]+$/; 

    return { 
     title: 'some title', 
     minWidth: 300, 
     minHeight: 150, 
     contents: [{ 
      id: 'initial-view', 
      label: 'view one', 
      title: generalLabel, 
      elements: [{ 
       id: 'name-one', 
       style: 'width: 100%;', 
       type: 'html', 
       html: 'Organizational units' 
      }, { 
       type: 'button', 
       id: 'buttonId', 
       label: 'Click me', 
       title: 'My title', 
       setup: function(widget) { 

        }, 
       onClick: function(widget) { 
        // this = CKEDITOR.ui.dialog.button 
        My code should go here........? 
       } 
      }] 
     }, { 
      id: 'organizational-unit-view', 
      label: 'view two', 
      title: generalLabel, 
      elements: [ 
       // Dialog window UI elements. 
       { 
        id: 'list-of-vars', 
        style: 'width: 100%;', 
        type: 'html', 
        html: 'second view --- html goes here', 
        label: lang.name, 
        setup: function(widget) { 
         this.setValue(widget.data.name); 
        }, 
        commit: function(widget) { 
         widget.setData('name', this.getValue()); 
        } 
       } 
      ] 
     }] 
    }; 
}); 

제 질문은 어떻게 처리해야합니까? 어떤 방법을 사용해야합니까? 기본적으로 뷰 2를 여는 방법은 무엇입니까?

답변

0

해결책을 찾았습니다. 이처럼

this.getDialog().selectPage('your-content-id); 

:

onClick: function(widget) { 
    this.getDialog().selectPage('organizational-unit-view'); 
} 
클릭 이벤트에 getDialog()를 사용한다입니다