DataView Web Part - Datatables JQuery. Removing filtering/sorting from SharePoint
We moved to SharePoint Online and I am trying to use some code I put together to pull in a Dataview web part and then have the table search able using Datatables.js
I was having trouble figuring out how to turn off the filtering and the sorting that is native to the SharePoint webpart so I opted to hide that row and replace it was a new row that is generated by script.
However, it appears that when Datatables is staging the table to display it is ignoring this new row that was added programatically.
I had to find the table based on a custom attribute and then force an ID attribute and that is all working. I just can't get the new row to become part of the DataTable display.
One way to test is to put an alert('whatever') just after the prepend line. That will force JS to wait until you click OK before initializing the datatable.
If the new row now appears in the datatable, the permanent solution would be to use a promise on the line that prepends the row.
I'm not sure if this is going down the right track so I'll stop here until you've had a chance to test the theory using an alert.