数据表可编辑与IE有问题

时间:2013-12-15 11:46:38

标签: jquery datatables jeditable spservices

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

  1. IE 9,10,11
  2. jQuery 1.7.2
  3. spservices 2013.01
  4. datatable 1.9.4
  5. datatable editable 2.3.3
  6. jedittable N / A
  7. 现在问题是数据代码的编辑在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可能会出现什么问题

1 个答案:

答案 0 :(得分:0)

这可能不是您需要的答案,但根据您的上一条评论,看起来您的代码在IE的JavaScript调试器运行时成功运行但不正常。这可能是由于任何console.log或其他类型的“仅调试器js代码”。以下是您的问题的可能答案:My application works in IE only in debug mode (works in other browsers)