javascript - Sync dataview with database -


i'm using slickgrid dataview edit tables 5000 rows, getting data mysql database using laravel. have created ajax save function saves data database runs extremely , freezes grid few seconds:

function testsave() {      var request;     var token = $('meta[name="csrf-token"]').attr('content');      request = $.ajax({         url: "/est/public/estimate/{{ $id }}",         type: "patch",         datatype: "json",         params: {_token:token},         async: true,         data: { data: json.stringify(dataview.getitems()), _token:token         }     });  } 

is there way of saving data without freezing? thought of using grid.onclick or onbeforeeditcell , saving each row individually when changes, functions inserting row change "order" value on every row below insert.

what best way keep dataview , database in sync?

this complex issue.
firstly, ajax call should asynchronous, shouldn't block 5 seconds.
if passing 5000 rows server, json encoding taking while. best passing changed rows server. in lot more complex @ first seems.

you might best using existing framework handle data you. breeze choice.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -