Change button label in Table

Change button label in Table

Hildeb67Hildeb67 Posts: 57Questions: 16Answers: 1

Is it possible to change the switch label of a button
I have the following button in a row that should have a different text when clicked

columns: [  
{
        data: null,
        defaultContent: '<button>MZF</button>',
        targets: -1
            }
        table.on('click', 'button', function (e) {

Here I want to change the text of the button

      ???? defaultContent = "Fertig";


            });

is this possible ?

greetings chris

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,524Questions: 1Answers: 10,273 Site admin
    Answer ✓

    Hi Chris,

    this.innerHTML = "Fertig";
    

    should do the job.

    In the event handler there, the scope of this will be the button which is how that works.

    Allan

  • Hildeb67Hildeb67 Posts: 57Questions: 16Answers: 1

    Thank you very much for the tip, it worked

Sign In or Register to comment.