pass data object to editor.edit()

pass data object to editor.edit()

INTONEINTONE Posts: 153Questions: 58Answers: 6

I have already created my editor but want to edit data that is not in a datatables list but in a simple list created using jquery. So this is not possible:

                var sele = $('#row_' + a.getAttribute('data-workid'));
                        editor.title(
                            'Details'
                        ).buttons({
                            "label": "Update",
                            "className": "btn",
                            "fn": function() {
                                editor.submit()
                            }
                 }).edit(sele);

but is something like this possible, to pass an object to editor item as a data source?



editor.title( 'Details' ).buttons({ "label": "Update", "className": "btn", "fn": function() { editor.submit() } }).edit(someDataObject);

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    The way to do this is to use the val() or field().val() method to set the values to be edited. There is no option to pass a data object into edit() - it will always take an identifier to be edited.

    Allan

This discussion has been closed.