Kendo sortable : cannot edit text input inside of the sortable table

六眼飞鱼酱① 提交于 2019-12-12 12:22:51

问题


I have following sortable table with sortable rows by using:

http://demos.telerik.com/kendo-ui/sortable/events

<tbody class="playlist" kendo-sortable k-placeholder="placeholder" k-hint="hint">
    <!-- IF NOTHING IS FOUND-->
    <tr ng-if="projectDetail.projectOrderViewConfiguration.projectEntries.length == 0">
        <td colspan="9"><h1>{{ 'ADD_SOME_ITEMS_FROM_LEFT_COLUMN' | translate }}</h1></td>
    </tr>
    <!-- ELSE WRITEOUT-->
    <tr  ng-repeat="projectEntry in projectDetail.projectOrderViewConfiguration.projectEntries">
        <td>
        <input type="text" ng-model="projectEntry.entry.defaultName"  class="form-control" id="cwConnectorTeam" value="{{entry.defaultName}}" />
        </td>
        <td>
        <input type="text" ng-model="projectEntry.projectLabel"  class="form-control" id="cwConnectorTeam" value="{{entry.defaultName}}" />
        </td>
        <td><a ng-click="removeProjectEntryItem('{{projectEntry.id}}')">remove</a></td>
    </tr>
    <!-- ELSE WRITEOUT-->
</tbody>

and JS

// MAKE SELECTED ENTRIES SORTABLE
$scope.placeholder = function(element) {
    return element.clone().addClass("placeholder").text("drop here");
};
$scope.hint = function(element) {
    return element.clone().addClass("hint");
}; 

Problem is that if I tried to click on input filed I found that is not editable (maybe some z-index layer on high position).

I would like to have sortable and editable rows together. How can I solve it?


回答1:


Kendo UI's sortable widget now has a way of handling this with an ignore option:

$("#sortable").kendoSortable({ 
    ignore: "input"
});


来源:https://stackoverflow.com/questions/27405996/kendo-sortable-cannot-edit-text-input-inside-of-the-sortable-table

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!