0

Html Code: I'm using plain table with few column headers

<table id="gvAssgin" class="table table-striped table-bordered table-hover">
      <thead>
           <tr>
             <th>ModemName</th>
             <th>AssignedTo</th>
             <th>AssignDate</th>
             <th>ReturnedDate</th>
             <th>CreatedName</th> 
           </tr>
      </thead> 
 </table> 

Js Code: Here is js method which im using,

var oTable = $('#gvAssgin').dataTable
           ({
               "bProcessing": true,
               "bServerSide": true,
               "sAjaxSource": "AssignHistory.aspx/getAllModemAssign",
               "fnServerData": function(sSource, aoData, fnCallback) {
                   $.ajax({
                       type: "POST",
                       url: "AssignHistory.aspx/getAllModemAssign",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       data: "{}",
                       success: function (json) {
                           fnCallback(json)
                       },
                       error: function (xhr, textStatus, errorThrown) {
                           alert(xhr.responseText);
                       }
                   });
               },
               "columns": [
                   { data: "ModemName" },
                   { data: "AssignedTo" },
                   { data: "AssignDate" },
                   { data: "ReturnedDate" },
                   { data: "CreatedName" } 
               ]
           });

In browser debugging i can see result in json.d, But, No data visible on page. I don't know what is the issue in this code.

Here is the screen shot on browser console screen, enter image description here

5
  • Make json output into a string then you can inspect it . Use this to make json to String $.param(jsonObj) Commented Feb 5, 2016 at 8:30
  • I generally find it helpful to check the type of data returned with something like console.log(typeof json), that way you'll be sure that what you're expecting is what you get. Commented Feb 5, 2016 at 8:58
  • I have added screen shot of console screen this might be more helpful to suggest me Commented Feb 5, 2016 at 9:06
  • Are you getting any errors? Commented Feb 5, 2016 at 9:43
  • No errors i found.. Thanks for your support..The above code is not complete. Commented Feb 5, 2016 at 11:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.