检测td变化

时间:2016-04-28 14:52:29

标签: javascript jquery angularjs jquery-selectors

编辑:下面的代码。

我有一个非常奇怪的问题,如果你点击一个包含一个按钮的表格单元格(td)但是由于某种原因实际上没有点击按钮,那么在按钮之前或之后会有一大堆插入到单元格中哪个吹了我的桌子。我正在尝试编写一个事件处理程序来处理它,但我似乎无法使选择器正确,因为它永远不会触发。那么我将如何创建具有以下要求的事件处理程序:

  1. 触发包含按钮元素的所有td元素的更改
  2. 触发后,用空字符串“”
  3. 替换触发td元素的所有内容
  4. 必须使用使用角度重复构建的动态表
  5. 或者有人知道一种方法可以防止愚蠢的出现在第一位吗?谢谢!

    <tr data-dir-paginate="item in postItemsDisplay | itemsPerPage: listItemsPerPage" data-total-items="totalItems" data-current-page="pagination.current">
        <td style="width:26px;">
            NBSP's SHOW UP HERE<button type="button" class="btn btn-default btn-xs" data-ng-click="CopySingleItem(item.Id)" data-toggle="modal" data-target="#modal2"><i class="fa fa-pencil"></i></button>NBSP's SHOW UP HERE
        </td>
        <td><span data-ng-if="item.Attachments.results.length > 0"><i class="fa fa-lg fa-paperclip"></i>&nbsp;</span><a data-ng-attr-title="{{item.Title}}" onmouseover="javascript:this.style.cursor='pointer';" data-ng-click="SPModal(item.Id)">{{item.Title}}</a></td>
        <td>{{item.SingleText1}}</td>
        <td>{{item.SingleText2}}</td>
        <td>{{item.ChoiceColumnValue}}</td>
        <td style="width:26px;">
            NBSP's SHOW UP HERE<button type="button" class="btn btn-danger btn-xs" data-ng-click="DeleteConfirmation('TestList',item.Id)" data-toggle="modal" data-target="#deleteConfirmation"><i class="fa fa-trash-o"></i></button>NBSP's SHOW UP HERE
        </td>
    </tr>
    
    $scope.CopySingleItem = function (id) {
        $scope.currentItem = angular.copy(DataUtilitySvc.GetJsonByKey($scope.postItems, "Id", id));
        $scope.currTitle = $scope.currentItem.Title;
    }
    

    这是一个IE问题,因为它只发生在IE 10模式,不幸的是我必须支持。它不会在边缘模式下发生,但不幸的是其他问题在边缘模式下开始发生,因此我基本上只需要选择要修复的内容。我真的很讨厌IE。

0 个答案:

没有答案
相关问题