inline button for new row

inline button for new row

MadMax76MadMax76 Posts: 149Questions: 33Answers: 1

I have a button inlne in each row calling this function:

        $('#chat').on('click', 'td.editor-edit', function (e, dt, node, config) {
            e.preventDefault();
            var rowlast = table.row( ':last-child' ).data();
            editor_chat2
                .create( )
                .title ('Antworten')
                .buttons ('senden')
                .set( 'chat_antwortauf', rowlast[fields[1].value])
            } );

Problem is to get a value into "chat_antwortauf" from the row where the function is called from.

Thanks
Max

This question has an accepted answers - jump to answer

Answers

  • MadMax76MadMax76 Posts: 149Questions: 33Answers: 1

    additional question: I am trying to change the mouse pointer to cursor: 'pointer'; therefore I would have to add a class, but I also have a classname pointing at the "td.editor-edit" - how can I get both?

  • allanallan Posts: 61,438Questions: 1Answers: 10,049 Site admin
    Answer ✓

    Hi Max,

    $('#chat').on('click', 'td.editor-edit', function (e, dt, node, config) {
        e.preventDefault();
        var row = table.row( this.parentNode ).data();
    
        editor_chat2
            .create( )
            .title ('Antworten')
            .buttons ('senden')
            .set( 'chat_antwortauf', row.chat_antwortauf)
        } );
    

    should do it. You might need to change the row.chat_antwortauf depending on where the value is that you actually want to set. I've assumed your row is an object of data with a chat_antwortauf property.

    I am trying to change the mouse pointer to cursor: 'pointer'; therefore I would have to add a class, but I also have a classname pointing at the "td.editor-edit" - how can I get both?

    td.editor-edit {
      cursor: pointer;
    }
    

    in your CSS should do it.

    Allan

  • MadMax76MadMax76 Posts: 149Questions: 33Answers: 1

    Thanks!

Sign In or Register to comment.