Sunday, 15 April 2012

javascript - jquery datatable gives error when rendering -


I'm trying to fill the data with AJAX with jQuery Datatable:

HTML

& lt; Table ID = "Table-Product Content" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Id & lt; / Th & gt; & Lt; Th & gt; Name & lt; / Th & gt; & Lt; Th & gt; Quantity & lt; / Th & gt; & Lt; Th & gt; Status & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; / Table & gt;

javascript

  $ (document) .ready (function () {var options = {"processing": true, "ajax": {"url "(Product)". ("# Product_id"). Val ()}, "column": [{"Data": "productmakers.Shex? Action = find", "type": "post", "data ": {" Product ID "}:" id "}, {" data ":" name of content "}, {" data ":" quantity "}, {" data ":" status "}]}}} table = $ ('# Table-Product Content'). DataTable (Option);}); General Handle Output:  
  {"Data": [{"ID": 1, "Quantity" : 15.00, "Status": "1" Content Name ":" Iron ", "Product name": "French onion soup"}, {"id": 3, "quantity": 14.00, "condition": "1", "content name": "nail" "product name": "French onion Soup "}]}  

Error message when reloading data: DataSlow warning: table id = table-product content - unknown parameter '0' requested for line 0. More information about this error, please see

I have sent this page and have read an example, but this can not be solved. What am i doing wrong

You must retain the property of the column outside the AJAX property in this way:

 < Code: $ (document) .ready (function () {var option = {"processing": true, "Ajax": {"url": "productive content. Shakes? Action = get", "column": [ "Data": "Data": "Data": "" "," Data ": {" Product ID ": $ ('# Product_ID'). Val ()}," Data ":" Content Name "}, {" Data ":" Quantity "}, {" Data ":" Status "}]}} Table = $ ('# Table-Product Content'). Datatelle (Option);});  

Then it will work.


No comments:

Post a Comment