DataTable updating row

DataTable updating row

chalkegchalkeg Posts: 6Questions: 3Answers: 0

Below function is to update datatable row which is now updated by user. I am not able to see fresh data updated after executing this function. debugging shows thisrow object has updated information so it seems i am doing something wrong during draw.

I am using latest DataTable js

       function updateTable(tableName, listName) {
          var siteUrl = _spPageContextInfo.webAbsoluteUrl;
          console.log("Item id is "+itemId);
          var thisrow = tableName.row( {"Title": itemId} ).data();

        getListItemWithId(itemId,listName,siteUrl,function(data){
            //console.log(JSON.stringify(data));
            thisrow.AG_ID = data["AG_ID"];
            thisrow.CellNo = data["CellNo"];
            console.log(thisrow.AG_ID + ' ' +thisrow.CellNo);
            tableName.row( {"Title": itemId} ).invalidate();
            tableName.row( {"Title": itemId} ).data( thisrow ).draw();
            },
            function (error) {
            console.log(error);
            });
            }

Answers

  • chalkegchalkeg Posts: 6Questions: 3Answers: 0

    workaround solution : i am deleting existing record and inserting updated one.

This discussion has been closed.