6

我正在使用 spservices、datatable、jeditable 和 datatable.editable 处理 SharePoint 2010。我的框架版本如下

  1. 即 9、10、11
  2. jQuery 1.7.2
  3. spservices 2013.01
  4. 数据表 1.9.4
  5. 数据表可编辑 2.3.3
  6. 可编辑的 N/A

现在的问题是数据表的编辑在 FireFox 和 Chrome 中运行良好,但是当我从元素模糊时它在 IE 中不起作用,它并没有消失。

我的代码如下

  <link rel="stylesheet" type="text/css" href="/sites/MS/Style%20Library/en-us/CSS/forms-simple.css"/>

  <script type="text/javascript" src="/sites/ms/Style%20Library/en-us/JS/jquery.min.js"></script>
  <script type="text/javascript" src="/sites/ms/Style%20Library/en-us/JS/jquery.SPServices-2013.01.min.js"></script>
 <script type="text/javascript" src="/sites/ms/Style%20Library/MarketSurveillance.js"></script>
  <script type="text/javascript" src="/sites/MS/Style%20Library/ar-sa/JS/jquery.dataTables.min.js"></script>
 <script type="text/javascript" src="/sites/MS/Style%20Library/en-us/JS/jquery.jeditable.mini.js"></script>
<script type="text/javascript" src="/sites/MS/Style%20Library/en-us/JS/jquery.dataTables.editable.js"></script>
 <script type="text/javascript">
 $(document).ready(function () {
var oTable, anOpen = [], sImageUrl = "/sites/MS/Style%20Library/Images/", sInner;
var viewFields = "<FieldRef Name='ID' /><FieldRef Name='Title' /><FieldRef Name='TelephoneNo' /><FieldRef Name='PlaceOfProduct' />";
viewFields += "<FieldRef Name='CategoryID' /><FieldRef Name='SubCategoryID' /><FieldRef Name='Status' />";
populateGrid("/sites/ms/", "ComplaintForm", viewFields, "", handleData);

oTable = $("#tbComplaintForm").dataTable({
  "bProcessing": true,
  "aoColumns": [
     {
       "bSortable": false,
       "mDataProp": null,
       "mData": null,
       "sClass": "control center",
       "sDefaultContent": '<img src="' + sImageUrl + 'details_open.png">'
     },
    null ,
    null ,
    null ,
    null ,
    null ,
    null
  ]
});

oTable.makeEditable({
  "aoColumns": [
    null, null, null, null, null, null,
    {
      "sName": "Status",
      "indicator": "Approve/Reject Complaint Status",
      "tooltip": "Approve/Reject",
      "loadtext": "loading...",
      "type": "select",
      "onblur": "submit",
      "data": "{'0':' ', '3':'Approved','4':'Rejected'}",
      "sUpdateURL": function (value, settings) {
        var columnId = oTable.fnGetPosition(this)[2];
        var dataArray = [];
        dataArray.push([oTable.fnSettings().aoColumns[columnId].sTitle, value]);
        itemOperation("/sites/ms/", "ComplaintForm", "Update", dataArray, $(this).closest('tr').attr('id'));
        return value;
      }
    }
  ],
  "oEditableSettings": { event: 'click' }
});

$('#tbComplaintForm td.control').live('click', function () {
  var nTr = this.parentNode;
  var i = $.inArray(nTr, anOpen);

  if (i === -1) {
    $('img', this).attr('src', sImageUrl + "details_close.png");
    var nDetailsRow = oTable.fnOpen(nTr, fnFormatDetails(oTable, nTr), 'details');
    $('div.innerDetails', nDetailsRow).slideDown();
    anOpen.push(nTr);
  }
  else {
    $('img', this).attr('src', sImageUrl + "details_open.png");
    $('div.innerDetails', $(nTr).next()[0]).slideUp(function () {
      oTable.fnClose(nTr);
      anOpen.splice(i, 1);
    });
  }
  });
 });

   function fnFormatDetails(oTable, nTr) {
var oData = oTable.fnGetData(nTr);
var _viewFields = "<FieldRef Name='Comments' /><FieldRef Name='Suggestions' />";
var qry = "<Query><Where><Eq><FieldRef Name=\"ID\" /><Value Type=\"Counter\">" + $(nTr).attr('id') + "</Value></Eq></Where></Query>";
populateGrid("/sites/ms/", "ComplaintForm", _viewFields, qry, innerData);
var sOut = sInner;
return sOut;
}

  function innerData(xData, Status) {
sInner = "";
sInner += '<div class="innerDetails"><table cellpadding="7" cellspacing="0" border="0" style="padding-left:75px;">';
if (Status == "success") {
  $(xData.responseXML).SPFilterNode("z:row").each(function () {
    sInner += '<tr><td>Comment:</td><td>' + $(this).attr("ows_Comments") + '</td></tr>';
    sInner += '<tr><td>Suggestions:</td><td>' + $(this).attr("ows_Suggestions") + '</td></tr>';
  });
}
sInner += '</table></div>';
 }

  function handleData(xData, Status) {
var datarows = "<tbody>";
var query = "";
if (Status == "success") {
  $(xData.responseXML).SPFilterNode("z:row").each(function () {
    datarows += "<tr id=" + $(this).attr("ows_ID") + "><td class='read_only'></td><td>" + $(this).attr("ows_Title") + "</td>";
    datarows += "<td>" + $(this).attr("ows_TelephoneNo") + "</td>";
    query = "<Query><Where><Eq><FieldRef Name=\"ID\" /><Value Type=\"Text\">" + $(this).attr("ows_CategoryID").replace(".00000000000000", "") + "</Value></Eq></Where></Query>";
    datarows += "<td>" + getSingleItem("http://sp2010-base", "SAS_Categories", "Category_Title_EN", query) + "</td>";
    query = "<Query><Where><Eq><FieldRef Name=\"ID\" /><Value Type=\"Text\">" + $(this).attr("ows_SubCategoryID").replace(".00000000000000", "") + "</Value></Eq></Where></Query>";
    datarows += "<td>" + getSingleItem("http://sp2010-base", "SAS_SubCategories", "Sub_Category_Title_EN", query) + "</td>";
    datarows += "<td>" + $(this).attr("ows_PlaceOfProduct") + "</td>";
    if ($(this).attr("ows_Status") == 0)
      datarows += "<td></td></tr>";
    else if ($(this).attr("ows_Status") == 1)
      datarows += "<td>In Plane</td></tr>";
    else if ($(this).attr("ows_Status") == 2)
      datarows += "<td>Checked</td></tr>";
    else if ($(this).attr("ows_Status") == 3)
      datarows += "<td>Approved</td></tr>";
    else if ($(this).attr("ows_Status") == 4)
      datarows += "<td>Rejected</td></tr>";
  });
  datarows += "</tbody>";
  $("#tbComplaintForm").append(datarows);
}
}

投诉名称 电话号码 类别 子类别 产品状态

那么IE可能会出现什么问题

4

1 回答 1

0

这可能不是您需要的答案,但根据您最后的评论,当 IE 的 JavaScript 调试器运行但不正常时,您的代码似乎可以成功运行。这可能是由于任何 console.log 或其他类型的“仅调试器 js 代码”造成的。这是您问题的可能答案:我的应用程序仅在调试模式下在 IE 中工作(在其他浏览器中工作)

于 2013-12-29T14:31:33.103 回答