Submit button only to specific column

Submit button only to specific column

LairdTurnerLairdTurner Posts: 7Questions: 3Answers: 0

Hi!

How can I display a submit button only for a specific column and use for the rest a normal inline edit?
For example: My table has 10 rows and I want on column 5 with a textarea an submit button and for the rest a 'normal' inline edit.

Thanks!

-René

Replies

  • LairdTurnerLairdTurner Posts: 7Questions: 3Answers: 0

    Solved! Added a class to specific columns and selected on this class.

  • dataBdataB Posts: 23Questions: 5Answers: 1

    Good solution! I couldn't get it to work at first but finally got things working with the code below. (I decided to go with bubble instead of buttons but the idea is the same)

    $('#groupsTable').on( 'click', 'tbody td:not(:first-child)', function (e) {
                if ($(this).closest( "td" ).hasClass("submitbtn")) {
                    console.log("submit class")
                    editor.bubble( this );
                } else {
                    editor.inline( this );
                }
                
            } );
    
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Very nice - thanks for suggesting this. For anyone else reading this columns.className can be used to add a class to a column.

    Allan

This discussion has been closed.