markcell / jquery-tabledit

Inline editor for HTML tables compatible with Bootstrap.
http://markcell.github.io/jquery-tabledit/
MIT License
435 stars 208 forks source link

ondraw() executes before DB data loads #121

Closed LouwP closed 5 years ago

LouwP commented 5 years ago

Hello all, I apologize if this is a stupid question ... but I am 'n newbie to JS and PHP programming. If I build a standard HTML table and 'hard code' the table data .. then TableEdit works and gives me edit and delete buttons on all rows. However - when I load data from mysql json and build rows in javascript ... there are no edit and delete buttons. It seems that the TableEdit "ondraw()" function completes before the data is retrieved and loaded in the table. Can someone please help to give me the right way to load data from DB ... an get TableEdit to add "editable" buttons. Help will be very much appreciated.

LouwP commented 5 years ago

OK - so I got it figured. You do a $.ajax to get the table data and only on ".done" do you call TableEdit().