Edit with a value not present in the dropdown list

Edit with a value not present in the dropdown list

nico077nico077 Posts: 55Questions: 14Answers: 2
edited August 2016 in General

Hello,

i have a problem when i use the script

$('#budget').on( 'click', 'tbody td:nth-child(19)', function (e) {
    // console.log($(this).closest("td"));
    if(table.row( this ).data().budget.vu_dgp == 1){
        editor
        .edit($(this).closest("td"), false )
        .set( 'budget.vu_dgp', 0)
        .submit();
    }
}

When i use this script i want to only edit the field 'budget.vu_dgp' but the problem:
If on my edit row, i have a select with a value that is not in the dropdown list. So the value of the select is edit and the datatable take the first value of the select...

So my question is : why can i edit a cell but not the row ??

Best regards,
Nicolas

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • nico077nico077 Posts: 55Questions: 14Answers: 2

    Like the behavior of the function bubble

  • nico077nico077 Posts: 55Questions: 14Answers: 2

    I want to use the function
    cell().edit() --> Edit a cell with inline or buble editing

    But the API reference doesn't work.

    Best regards,
    Nicolas

  • allanallan Posts: 61,665Questions: 1Answers: 10,096 Site admin

    Use:

    .edit($(this).closest("td"), false, { submit: 'changed' } )
    

    See the submit option's documentation in the form-options object. Basically it just tells Editor to submit only the changed values rather than everything.

    Allan

This discussion has been closed.