Print Button

Print Button

churchilchurchil Posts: 34Questions: 5Answers: 0

Hi guys,

do you know how i can add an print button in here? (picture)
i used that code for the rest of the buttons.

    //Button Farbe
    buttons: {
        className: "btn-light",   
    buttons: [

        //Neu and Cancel Button
        { extend: 'create', className: 'btn-light', text: 'Neu', editor: editor,
            formButtons: [
                'Neu',
                { text: 'Cancel', action: function () { this.close(); } }
            ] 
        },  

        //Edit Button + Funktion für vor, zurück und speichern
        { extend: 'selected',className: 'btn-light', text: 'Bearbeiten',editor: editor,
        action: function () {      
                var indexes = table.rows( {selected: true} ).indexes();                    
                editor.edit( indexes, {
                    title: 'Bearbeiten',
                    buttons: indexes.length === 1 ?
                        backNext :
                        'Save'
                } );
            }, 
        },

        //Delete and Cancel Button
        { extend: 'remove', className: 'btn-light', text: 'Löschen', editor: editor,
        formMessage: function ( e, dt ) {
                var rows = dt.rows( e.modifier() ).data().pluck('bez');
                return 'Sicher das du folgende Einträge löschen möchtest? '
        },
        formButtons: [
                { text: 'Abbrechen', action: function () { this.close(); } },
                    'Löschen'
        ]},      

        //Reihenanzeige Button
        { extend: 'pageLength', className: 'btn-light'},

        //Vorstellungsformular
        { extend: 'selected',className: 'btn-light', text: 'Vorstellungsformular', editor: editor2, 
        action: function () {      
                var indexes = table.rows( {selected: true} ).indexes();                    
                editor2.edit( indexes, {
                    title: 'Vorstellungsformular',
                    buttons: indexes.length === 1 ?
                        backNext :
                        'Save' 
                } )
        }, 
        }

Answers

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    this is my edit window

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @churchil ,

    do you know how i can add an print button in here?

    Do you mean on an Editor form?

    Cheers,

    Colin

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    yes

  • colincolin Posts: 15,146Questions: 1Answers: 2,586

    Hi @churchil ,

    You would add a custom form button with formOptions like this example here. I couldn't find an example which prints the form's contents - you could possibly use the Buttons extension as a starting point perhaps.

    Cheers,

    Colin

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    Yes i want to have it like the example.
    but why i cant Print with this button?

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    Can you help me one more time

    i dont now how it looks like with my button

    can you show me the code that i can see it with my code? The Print button inside this button?

            { extend: 'selected',className: 'btn-light', text: 'Vorstellungsformular', editor: editor2,
            action: function () {      
                    var indexes = table.rows( {selected: true} ).indexes();                    
                    editor2.edit( indexes, {
                        title: 'Vorstellungsformular',
                        buttons: indexes.length === 1 ?
                            backNext :
                            'Save'
                    } )
            },
            }
    
  • churchilchurchil Posts: 34Questions: 5Answers: 0

    ok i know why the button dont work
    but how can i include this button in my script (picture above)

  • churchilchurchil Posts: 34Questions: 5Answers: 0

    it already work

This discussion has been closed.