2012-12-12 83 views
0

我正在使用我的表sortable插件和x-editable。 我可以拖放行和x可编辑我可以编辑单元格内容。Jquery Ui可排序块X可编辑

我的排序电话:

$('.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'); 
}); 

,但它不工作。

回答

1

这是因为你应用disableSelection()方法。