javascript - How to handle database null values in jquery datatable -
i have jquery datatable data coming database,fetched java servlet.few columns have null values.because of getting warning
datatables warning: table id=lplist - requested unknown parameter 'feecompany' row 9. more information error, please see http://datatables.net/tn/4
i want null values replaced empty string.can please guide how achieve this.
my code snippet below
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="http://cdn.datatables.net/1.10.4/js/jquery.datatables.min.js"></script> <script src="http://cdn.datatables.net/scroller/1.2.2/js/datatables.scroller.min.js"></script> <link href="http://cdn.datatables.net/scroller/1.2.2/css/datatables.scroller.css" rel="stylesheet" type="text/css" /> <link href="http://cdn.datatables.net/1.10.4/css/jquery.datatables.css" rel="stylesheet" type="text/css" /> <title>insert title here</title> <script type="text/javascript"> $(document).ready(function () { $("#lplist").datatable({ "serverside": true, "sajaxsource": "/jquerydatatablesall/companygsonobjects", dom: "rtis", scrolly: 450, scrollx:true, "processing": true, "aocolumns": [ { "mdata": "insuredname" }, { "mdata": "custaddress_city" }, { "mdata": "custaddress_state" }, { "mdata": "custaddress_zip" }, { "mdata": "custsurvey_location" }, { "mdata": "policyno" }, { "mdata": "profitcenter" }, { "mdata": "feecompany" }, ] }); }); </script> </head> <body id="dt_example"> <div id="container"> <div id="links"> server-side processing object source <br /> </div> <div id="demo_jui"> <table id="lplist" class="display"> <thead> <tr> <th>insured name</th> <th>city</th> <th>state</th> <th>zip</th> <th>survey location</th> <th>policyno</th> <th>profit center</th> <th>fee company</th> </tr> </thead> <tbody> </tbody> </table> </div> </div>
add defaultcontent in options while initializing data table. more details
Comments
Post a Comment