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

Allow beforeDelete function to access deletable row on remove #47

Open mahmed0715 opened 6 years ago

mahmed0715 commented 6 years ago

Hi, I was working on an electron app, when I try to remove i needed a hack and added value function to access the row and delete from electron db manually, You know electron doesnt support http call, so I cant use remote mode, for local mode there is no such method implemented to access the deletable row before actual delete from data table.

I hope You understand and merge the pull request. Thanks NB: I adjusted the demo and you can see in action about the change..

galbini commented 6 years ago

Hi,

Thanks for your proposal, i try to study it quickly. Just two remarks, 1/ the term value is to generic may be beforeDelete is more adapted 2/ you used allResult rather displayResult and all result represant all the data and displayResult only the displaying data. If you have several page the index i is not good for other page than the first.

Best regards, Guillaume

mahmed0715 commented 6 years ago

thanks... i will check these two..

On Mon, Jun 4, 2018, 1:49 PM Guillaume Albini notifications@github.com wrote:

Hi,

Thanks for your proposal, i try to study it quickly. Just two remarks, 1/ the term value is to generic may be beforeDelete is more adapted 2/ you used allResult rather displayResult and all result represant all the data and displayResult only the displaying data. If you have several page the index i is not good for other page than the first.

Best regards, Guillaume

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/institut-de-genomique/Ultimate-DataTable/pull/47#issuecomment-394264838, or mute the thread https://github.com/notifications/unsubscribe-auth/AC1I7WYq35LNblgpKAUauz1mOz3Sf7AUks5t5OakgaJpZM4UVSE1 .

mahmed0715 commented 6 years ago

Please merge

mahmed0715 commented 6 years ago

Changes done as requested..Please merge

galbini commented 6 years ago

Hi,

Thanks you for your update, i think your feature very interesting but for me some improvements are needed.

1/ what's happen when beforeDelete not work ? beforeDelete must to be return a boolean (true => ok delete can be done, false => delete cannot be done) in the case of false, we need to alert the user.

2/ beforeDelete can also be call when we execute a remote delete.

what do you think about it ?

Best regards, Guillaume