i need show to copy buttons and filter combo

i need show to copy buttons and filter combo

drodriguezdrodriguez Posts: 8Questions: 2Answers: 0
edited June 2021 in General

I need to show the copy button and also the row quantity filter

I add the code that I use to generate the table:

$('#xxxx').DataTable({
                            "language": {
                            "url": "//cdn.datatables.net/plug-ins/1.10.21/i18n/Spanish.json",
                            buttons: {
                            
                                copyTitle: 'Dato Copiado',
                                copySuccess: {
                                                _: '%d Lineas Copiadas',
                                                1: '1 Linea Copiada'
                                            }
                            }
                           
                             }, "ordering": false  ,
                            buttons: [
                                {
                                    extend: 'copyHtml5',
                                    title: 'title example' ,
                                    text: '<div class="button-copy-kronos" data-toggle="tooltip" title="Copiar"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-files" viewBox="0 0 16 16"> <path d="M13 0H6a2 2 0 0 0-2 2 2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm0 13V4a2 2 0 0 0-2-2H5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1zM3 4a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4z"/> </svg></div>',
                                }
                            ]

                            });

Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

Answers

  • drodriguezdrodriguez Posts: 8Questions: 2Answers: 0

    if I show the button the filter is hidden and if I show the filter the button is hidden

  • kthorngrenkthorngren Posts: 20,270Questions: 26Answers: 4,765

    Looks like you have two buttons options. You can only have one. Move the lines 6-11 into the buttons array you have on line 14.

    Kevin

  • drodriguezdrodriguez Posts: 8Questions: 2Answers: 0

    I modified it like this, thank you very much1 I had not noticed the error, however I still see only one of the two

  • drodriguezdrodriguez Posts: 8Questions: 2Answers: 0
    edited June 2021
    $('#xxxx').DataTable({
                                    "language": {
                                        "url": "//cdn.datatables.net/plug-ins/1.10.21/i18n/Spanish.json",
                                         "ordering": false  , dom: 'Bfrtip',
                                        buttons: [
                                            {
                                                extend: 'copyHtml5',
                                                title: title example' ,
                                                text: '<div class="button-copy-kronos" data-toggle="tooltip" title="Copiar"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-files" viewBox="0 0 16 16"> <path d="M13 0H6a2 2 0 0 0-2 2 2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2 2 2 0 0 0 2-2V2a2 2 0 0 0-2-2zm0 13V4a2 2 0 0 0-2-2H5a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1zM3 4a1 1 0 0 1 1-1h7a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V4z"/> </svg></div>',
                                            }, {
                                        
                                            copyTitle: 'Dato Copiado',
                                            copySuccess: {
                                                            _: '%d Lineas Copiadas',
                                                            1: '1 Linea Copiada'
                                                        }
                                            }
                                        ]
                                    }
                                });
    

    Edited by Kevin: Syntax highlighting. Details on how to highlight code using markdown can be found in this guide

  • kthorngrenkthorngren Posts: 20,270Questions: 26Answers: 4,765

    In order to help we will need to see what you are doing. Please post a link to your page or a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

  • kthorngrenkthorngren Posts: 20,270Questions: 26Answers: 4,765

    Please use markdown to format your code. You have all your options, ordering, dom, buttons, inside the language option. Move them outside the language option. If you still need help then please provide a running test case showing the issue.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.