Bubble editing next to (this)

Bubble editing next to (this)

cha59cha59 Posts: 87Questions: 23Answers: 0
edited March 2020 in DataTables 1.10

Hi
I'm trying to use bubble editor to edit to the right of (this), but I cannot figure out how. My table is fine showing alle the data, that I want it to, but I want to be able to have a comment for each piece of data. So my idea is to have a note column to the right of each column of data, but these columns are invisible. So I need the bubble editor not to edit (this) - the data - but the cell to the right of the data, but the bubble editor should be activated when clicking on the data.

// Activate the bubble editor on click of a table cell
    $('#example').on( 'click', 'tbody td', function (e) {
        editor.bubble(this);
    } );

An example of my columns. budget.u31 is data and visible, budget.n31 is notes and invisible and so on.

{
                label: "Lektioner uge 31",
                name: "budget.u31"
            },  {
                label: "Noter uge 31",
                name: "budget.n31"
            },  {
                label: "Lektioner uge 32",
                name: "budget.u32"
            },  {
                label: "Noter uge 32",
                name: "budget.n32"
            },

Any ideas as to how this is possible?
Best regards
Claus

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,139Questions: 26Answers: 4,735
    Answer ✓

    I've used columns.editField for this. It can be an array of fields you want to edit. Not sure how you have your columns define in Datatables but somethign close to this should work:

        columns: [
            ....
            {
                data: budget.u31,
                editField: [
                    "budget.u31",
                    "budget.n31",
                ]
            }
        .....
        ]
    

    Kevin

  • cha59cha59 Posts: 87Questions: 23Answers: 0

    Thanks Kevin

This discussion has been closed.