2013-10-08 44 views
0

後通過Ajax請求刷新/重新加載jQuery的數據表Ajax請求刷新/重新加載jQuery的數據表後的細胞,當我嘗試看到提示框的任何單元格的數據也給出了數倍,但相同的警報,每次重裝後警報數量的增加,它看起來也越來越爲先前的Ajax請求的值。任何解決方案多值(相同),用於通過

  function reload(){ 
       $.ajax({ 
       type: "POST",     
       url: "../WebServices/HortalDay.aspx/GetHartalDay", 
       contentType: 'application/json; charset=utf-8', 
       dataType: "json", 
       success: function (d) {      
        var jObject = eval('(' + d.d + ');');      
        var input = { 
         "aaData": jObject, 
         "aoColumns": [{ "sTitle": "Hartal Date", "mData": "HartalDate", "sWidth": "20%" }, 
          { "sTitle": "Note", "mData": "Note" }, 
          { "sTitle": "Status", "mData": "Status" }, 

         ], 
         "aLengthMenu": [[10, 25, 50], [10, 25, 50]], 
         "iDisplayLength": 25, 
         "bProcessing": true, 
         "bJQueryUI": true, 
         "bPaginate": true, 
         "bdestroy": true, 
         "cache": false, 
         "aoColumnDefs": [ 
          { "aTargets": [0], 

           "sType": 'date', 
           "fnRender": function(oObj) { 
            var javascriptDate = parseDate((oObj.aData["HartalDate"])); 
            return javascriptDate; 
           } 
          } 
         ] 
        }; 

       }}) 
$("#datatable").dataTable(input); 

};

$("#btnShow").click(function(){ 
      reload(); 
var date = $('#datatable tr').filter(".row_selected").find('td:eq(0)').text()); 
      alert(date); 
       }); 
+0

大家都在觀望中去...... :),請問如果問題是不清楚 .... –

回答

0

得到了答案。只是我必須設置窗戶的位置 -

$("#btnShow").click(function(){ 
     window.location = "../SetupUI/HortalDaySetup.aspx"; 
     reload(); 
     var date = $('#datatable tr').filter(".row_selected").find('td:eq(0)').text()); 
     alert(date); 
      }); 

您可能會發現合乎邏輯的解釋在此鏈路 C# webservice calls using jQuery 1.7.1 /eval/seq/

相關問題