institut-de-genomique / Ultimate-DataTable

This AngularJS directive generate a HTML table with build-in fonctionnality like save, edit, remove, pagination etc...
http://institut-de-genomique.github.io/Ultimate-DataTable/
45 stars 26 forks source link

Filter cancel lost data bugfix #8

Closed ydeshayes closed 8 years ago

ydeshayes commented 8 years ago

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.

galbini commented 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

galbini commented 8 years ago

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

ydeshayes commented 8 years ago

New pull request https://github.com/institut-de-genomique/Ultimate-DataTable/pull/11