jquery-tabledit
jquery-tabledit copied to clipboard
How do I reload the table when a new row is added?
Is it possible to reload the plugin on a table when a new row is added? Or is there a remove function and then I can reload it fully?
Not in the plans, because it will duplicate things. But it's a good idea to create a method to destroy and reload.
I agree adding a new row is pretty important for a lot of real-world cases -- if a row can be deleted, why not added?
Great project though. Lightweight and functional for straightforward use.
I think if you can add new row . You can try add a default data to db , then you edit the new row :)
Any updates on this? I'm adding rows dynamically to a table and it would be great to have Tabledit parse the table on the fly!
Hey, this still not implemented, @nanexcool have you create a patch so ? ^^'
@benftwc Hey did you find a work around for this?
This is how I'm currently working around it: I add a dummy row to the database and then return the entire table in HTML with the dummy row and re-initialize tabledit. This allows the dummy row to be edited as normal. It's a little wonky but it works for an internal tool.
$("#table-account-mapping-add-new").on('click', function() { $.ajax({ type: "GET", url: "/add_new", cache: false, success: function(data, status) { $('#table-account-mapping').html(data); $('#table-account-mapping').Tabledit({ url: '/original_edit_url', columns: { identifier: [0, 'id'], editable: [[1, 'account_number'], [2, 'directory_path']] }, hideIdentifier: true }); }, error: function() { }
I tried to fetch the datatable with another Ajax and refresh every second, I can catch the new added lines but then its no longer support edit functionalities. Is it a limitation by Ajax or Javascript?