-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get edited object or id inside onEdit function #12
Comments
do you found any solution? |
Thanks for reaching out and using bstable! My appologies on a slow response @AhmMontasser , I missed this notification. Thanks for the poke @vipul386 . This was written some time ago so I found I was confused how to access the variables as well. Thanks for bringing it to my attention! The row that was edited becomes available to your I should mention while exploring this I noticed a sort-of bug. Currently the row must be referenced from an array. This will be fixed shortly. Here is an example:
In the future, it can be accessed like
I think the long term plan for this project is to move away from jQuery if possible so the element will be returned as a regular JS object. If you need the object in your function as a JQuery object you can run the following code (I removed the '$' to indicate that it is not a JQuery object but it really makes no difference, its just a variable name):
I hope this helps! I'll be updating the example code in index.html when the update is rolled out. Thanks for your contributions! |
I should clarify jQuery will still be used for the foreseeable future. Dont panic based on my previous comment :) Thanks again for reaching out @AhmMontasser & @vipul386 |
Hello Tom,
Thanks a lot for your work.
I was trying to build a custom onEdit function that will save data to the server but didn't find how to reference to the edited data inside the function, is it saved in same variable that I can use ?
I did the initiation as the following
$(document).ready( function () { $('#myTable').DataTable(); var editableTable = new BSTable("myTable",{ editableColumns:"1,2,3,4", onEdit: function() { //what to call here for the edited data? }, onBeforeDelete: function() {}, onDelete: function() {}, onAdd: function() {}, }); editableTable.init(); } );
Regards,
The text was updated successfully, but these errors were encountered: