jquery - Using ajax.dataSrc Option results `No matching records found` -


i have php project uses datatables. works fine , great.

continue next project uses asp.net webforms, have problem @ ajax part. different in php, in asp.net, got response single parameter in json object called d. therefore have alter response using ajax.datasrc.

however, turns out when implement in asp project, shows no matching records found. here ajax.datasrc code:

datatable: {     ajax: {     type: 'post',     url: window.location.href + '/getdata',     contenttype: 'application/json; charset=utf-8',     datatype: 'json',     datasrc: function (json) {          return $.parsejson(json.d);     } } 

in order test ajax.datasrc, tried implement in php project (the 1 works fine), tried use ajax.datasrc in , pass raw response without changing. here testing code in php project:

datasrc: function (json) {     return json; } 

it turns out table shows no matching records found well. conclude there must wrong ajax.datasrc.

so, question, use ajax.datasrc in correct way? if not, please show me example, @ least use ajax.datasrc , pass raw response?


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -