Super Slow Submit of Create with Lager DataTable (34K) using Editor DataTable.
Super Slow Submit of Create with Lager DataTable (34K) using Editor DataTable.
I have 34k of records inside my Datatable. When I use this set-up to Create a new record.
{text: 'Create',action: function () {this.submit();},tabIndex: 1}
With or without including my code to submit data JSON data to a data repository. The speed is super slow. It seems like the problem is with the speed of getting a new rowID back from the server to then update the Datatable. I am using Client side code.
The two reasons I believe this is true:
1. When I reduce the number of records inside the Datatable down to 5K, this problem goes away.
2. Even if I leave the number of records inside the DataTable to 34K and do an “Update” instead of a “Create” I do not have the problem – leading me to believe it is a retrieval of a new Row_ID that is slowing down the submit.
I really do not need to have the DataTable to show the new created record. I can create the new record back to the server and then do refresh page to show the new record within the datatable.
Here are other configurations.
dom: "Bfrtip",
data: dataSet,
order: [[1, 'asc'], [2, 'asc']],
deferRender: true,
pageLength: 200,
This question has an accepted answers - jump to answer
Answers
How is the row id created in the database? Is it just a serial / auto increment sequence, or do you have something more complex working it out?
Allan
Allan,
This app is creating an item (record in SharePoint) a list in SharePoint. But even if I take out the code to create an item/record - the submit is super slow because of the number of records in the Datatable.
I think if I could by past the create item/record in the Datatable when an users hits submit. I could then send my data over the wire using REST API's, then doing a refresh page, which would bring back the new record. I would be good! My issue is - I do not know of a way to by past creating an item/record in the Datatable when an user hits submit.
Any help would be deeply appreciated!
Bruce
Maybe using a custom button?
Maybe using a custom button/event to just send over the data using a REST API, and then having the page refresh to show the data in the Datatable may be an option.
I have a solution!!!!
editor.on('preSubmit', function (e, data, action) {
I need to change where or how I place the " $('#MyTable').DataTable().clear().draw();"
Because I need to identify, when I am doing a create and when I am doing an edit.
' editor.on('preSubmit', function (e, data, action) {
Done!
Thanks for the update - good to hear you got it working.
It's a bit surprising you need to do that though! A create submit action from Editor should only be submitting the data from the form - so the table size should make no difference.
Equally, if you are using client-side processing (which you appear to be) then only the new row would be returned from the Ajax call, which I would expect to be fast and independent of the table size as well.
I'm missing something in the bigger picture. If you are happy with it as it is now - fantastic. But I'm happy to dig further into what is going on if you are able to give me a link to the page in question.
Allan
Allan,
All that you stated was what I was thinking also. That is how I thought the Editor DT should work, but that was not the reality for us. If you find out something new, please keep us informed. As of now, this is our solution.
Thanks always for your help!!!!
Bruce
Allen,
I am sorry that I cannot provide a link to the site for security reasons.
Thanks
Bruce
No worries - I'll keep this thread in mind and if I see something similar again in future, I'll try to link them up.
Allan