我在我的表中使用了sortable插件和x-editable。我可以拖拽各行,使用x-editable我可以编辑单元格内容。
我的可排序调用:
$('.table-schichtplan tbody').sortable({
cancel : ".table-schichtplan-section,.table-schichtplan-break,.table-schichtplan-shift",
refreshPositions: true,
scroll: true,
containment: 'parent',
placeholder: 'ui-state-highlight',
}).disableSelection();X-可编辑(根据小提琴):
$('#username').editable({
type: 'text',
url: '/post',
pk: 1,
title: 'Enter username',
ajaxOptions: {
type: 'put'
}
});所以我点击#username,弹出的编辑窗口就会出现。但是我不能用鼠标选择文本,甚至不能用鼠标在输入栏中设置光标位置。只有当我删除可排序的部分时,它才能工作。似乎可排序插件阻塞了x-editable的某些部分。
看看这个小提琴:http://jsfiddle.net/xBB5x/49/
我试过这样的方法:
$('.editable-cell').on('shown', function() {
$('.table-schichtplan tbody').sortable('disable');
});
$('.editable-cell').on('hidden', function() {
$('.table-schichtplan tbody').sortable('enable');
});但它不起作用。
发布于 2013-02-01 21:03:21
这是因为您正在应用disableSelection()方法。
https://stackoverflow.com/questions/13839293
复制相似问题