Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 81971

Custom Multi-Edit Button

$
0
0

I feel kind of silly for asking, since it seems like a simple thing to do, but I want to make a custom edit button which can handle multiple selections. I've got an existing custom edit button that sits in each row and works just fine, and I figured I could adapt it, but then my brain decided to go away and I'm having a complete blank. Existing button:

$('.btn-edit').on('click', function(){
            e.preventDefault();

            area_loan_editor.edit( $(this).closest('tr'), {
                title: '<h3>Edit loan</h3>',
                buttons: {
                    label: 'Save',
                    className: 'btn-primary',
                    fn: function () {
                        this.submit();
                    }
                }
            });
        });

What I thought would work, but doesn't:

$('#editSelectedButton').on('click', function(){
            e.preventDefault();

            area_loan_editor.edit(area_loan_table.rows('.selected'), {
                title: '<h3>Edit loan</h3>',
                buttons: {
                    label: 'Save',
                    className: 'btn-primary',
                    fn: function () {
                        this.submit();
                    }
                }
            });
        });

Viewing all articles
Browse latest Browse all 81971

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>