jquery-tabledit icon indicating copy to clipboard operation
jquery-tabledit copied to clipboard

Page results

Open treadmillian opened this issue 10 years ago • 2 comments

If using Datatables (SpryMedia Ltd - datatables.net) and paged results, any pages >=2 do not have any icons. How can I resolve this?

Page 1 page1

Page 2 page2

treadmillian avatar Sep 30 '15 11:09 treadmillian

Hey, try to do something like that:

         $('#table').on('draw.dt', function(event, settings) {
            if (settings.json.recordsFiltered > 0) {
                $(this).Tabledit({
                    url: 'http://localhost/example',
                    editButton: false,
                    deleteButton: false,
                    columns: {
                        identifier: [0, 'id'],
                        editable: [[1, 'example']]
                    },
                    onSuccess: function(data) {
                        if (data.type && data.message) {
                            $('.alert-container').Alertiny(data.type, data.message);
                        }
                    }
                });
            } else {
                $(this).find('.tabledit-toolbar-column').remove();
            }
        });

markcell avatar Oct 07 '15 21:10 markcell

Hi @markcell, thanks for developing such a great plugin.

I am having the same issue, and deleting the toolbar column is not sufficient, as all the editable cells have been modified on the first run of tabledit. I adapted the plugin a bit so that it adds a class to all the rows after the first run, and modified the td selectors so that on subsequent runs they ignore the rows that have the class. It works like a charm.

Are you interested in a pull request?

GuillaumeSMedia avatar May 25 '17 23:05 GuillaumeSMedia