부분 편집 제한기능은 문서의 전체 혹은 일부를 편집이 불가능하도록 제한하는 방법을 의미합니다.
지정 가능한 대상 Element
Model | Tag |
---|
Body | <div class='se-content'> |
Div | <div> |
Table | <table> |
TableCell | <td> |
지정방법
소스코드에서 지정
소스보기에서 해당하는 Element에 `se-lock`, `se-unlock` class를 지정합니다.
Code Block |
---|
language | xml |
---|
title | lock, unlock 지정 |
---|
linenumbers | true |
---|
|
<div class="se-contents" style="font-family: Arial, Helvetica, sans-serif; font-size: 11pt; line-height: 1.2; padding: 25px;">
<table class="se-lock">
<tr>
<td>1</td>
<td class="se-unlock">2 - unlock</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
</div> |
API 사용
Code Block |
---|
language | xml |
---|
title | lock, unlock 지정 |
---|
linenumbers | true |
---|
|
<script>
window.editor.setLock('#lock-table');
window.editor.setUnlock('#unlock-cell');
</script>
<div class="se-contents" style="font-family: Arial, Helvetica, sans-serif; font-size: 11pt; line-height: 1.2; padding: 25px;">
<table id="lock-table">
<tr>
<td>1</td>
<td id="unlock-cell">2 - unlock</td>
</tr>
<tr>
<td>3</td>
<td>4</td>
</tr>
</table>
</div> |
동작 규칙
- 셀렉션은 lock/unlock상관없이 동작합니다.
- lock이 설정된 경우 그 자식 Element는 편집할 수 없습니다.
- unlock은 부모 Element에 lock이 설정된 경우에만 의미가 있습니다.
- unlock이 설정된 경우 자식 Element를 편집 할 수 있습니다.
체험하기