Uncaught TypeError: Cannot set property 'data' of null
<p>Hi i'm using below code for initialize data table content.</p>

<pre><code> var tblNotifications = $('#tblNotifications').DataTable({
                    "aoColumns" : [ null, null,null,null,null],
                     "processing": true,
                      "serverSide": true,
                });
</code></pre>

<p>And i have a function with ajax call to populate data from server on a button click.But i getting <code>jquery.dataTables.min.js:781 Uncaught TypeError: Cannot set property 'data' of null</code> error on console.</p>

<pre><code>function loadAllNotifications (){
            $.ajax({
                type : 'GET',
                url : 'loadAllNotifications',
                beforeSend : function() {
                    startPreloader();
                },
                 complete: function(){
                     stopPreloader();
                 },
                success : function(response) {
                    tblNotifications.fnClearTable();
                    var i=0;
                    _.each(response, function(item) {
                        var rowCount = i + 1;
                        tblNotifications.fnAddData([
                              rowCount!=0 ? rowCount : "",
                              item['receiverType']!=null ? item['receiverType'] : "",
                              item['subject']!=null ? item['subject'] : "",
                              item['createdDate']!=null ? myDateFormatter(item['createdDate']) : "" ,
                              '&lt;a id="'+item['id']+'" class="btnViewMoreInViewNotification btn tooltipped more color-sec" data-tooltip="More" data-position="left"&gt; &lt;i class="mdi-notification-more"&gt;&lt;/i&gt;&lt;/a&gt;'
                                     ]);
                        i++;
                    });
                }
                 });
        }
</code></pre>