정적 요소는 대부분 상호 작용할 수 없습니다 (다른 요소는 그 주위로 드래그 할 수 있지만 그게 전부입니다). ContentEdit/Tools를 사용하면 요소에 대한 일부 동작을 제한 할 수 있지만 텍스트 요소의 내용을 수정할 수는 없습니다 (지금까지는 추가 할 가치가 있다고 생각하지만).
그러나 그 순간에이 작업을 수행하는 정해진 방법은 없습니다 동안 여기에 당신이 (내가 당신을 얼마나 알려주 할) 당신이 설명하는 동작을 제공해야 그것을 사용할 수있는 접근 방식 :
ContentEdit.Root.get().bind('mount', function(element) {
// We only care about `TableCell` elements
if (element.type() != 'TableCell') {
return;
}
// We only want to make the element read-only if the parent table has
// the `data-read-only` attribute.
var table = element.closest(function(node) {
return node.type() == 'Table';
});
if (table.attr('data-read-only') !== undefined) {
// Disable text editing for the table cell
element.tableCellText()._onKeyDown = function(ev) {
ev.preventDefault();
}
}
// Disable dragging of the table rows
var tableRow = element.closest(function(node) {
return node.type() == 'TableRow';
});
tableRow.can('drag', false);
tableRow.can('drop', false);
});
작동하는 것으로 보인다는 . 도서관의 내적 활동에 대한 지식이 더 많을 때 나는 이와 같은 특징을 추가하여 기여하고자한다. 고맙습니다 –