Closed ydeshayes closed 8 years ago
Yann,
Why you execute searchLocal at the end of setEdit ? For me it's two differents functions. setEdit doesn't must not link to searchLocal. setEdit must just edit a line or a column.
Guillaume
Yann,
The function searchLocal generate other problem with the saveLocal function. For exemple you use searchLocal then you edit line and save. The method saveLocal replace a bad element in the allResult array.
I think, we need to rewrite all the searchLocal approach.
Guillaume
New pull request https://github.com/institut-de-genomique/Ultimate-DataTable/pull/11
https://github.com/institut-de-genomique/Ultimate-DataTable/issues/3
The _getAllResult was getting this.allResult var in the setEdit function, but we just want to cancel edit and remove so we've got to keep the filtered allResut so the real totalNumberRecords is the _getAllResult().length even if we cancel edit.
Then in the save function, as we change the this.allResult array, we've got to recall the filter function in order to compute the this.allResult and the closure in _getAllResult.