【问题标题】:Jquery Ui Sortable blocks X-editableJquery Ui Sortable blocks X-editable
【发布时间】:2023-03-15 01:25:01
【问题描述】:

我正在为我的表使用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-editable(根据小提琴):

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

但它不起作用。

【问题讨论】:

    标签: jquery jquery-ui twitter-bootstrap jquery-ui-sortable


    【解决方案1】:

    这是因为您正在应用disableSelection() 方法。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-14
      • 1970-01-01
      • 1970-01-01
      • 2014-10-28
      • 1970-01-01
      • 1970-01-01
      • 2011-01-25
      • 1970-01-01
      相关资源
      最近更新 更多