Editor field: datatables without ajax

Editor field: datatables without ajax

dudidudi Posts: 1Questions: 1Answers: 0
edited September 13 in Free community support


In the documentation i have the ajax option, but i have a nested json like this:
[{ first_name: '...', children: [{ name: '' , ...} ] } ]

const editor = new DataTable.Editor({
    data:: '../php/join.php', <-- this is not what i need, i need to access the children field in the row
    fields: [
            label: 'First name:',
            name: 'first_name'
            label: 'Children:',
            name: 'children',
            type: 'datatable',
            config: {
                columns: [
                        title: 'Name',
                        data: 'name'
    table: '#example'

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


  • allanallan Posts: 60,302Questions: 1Answers: 9,791 Site admin

    There isn't a data option for Editor. Line 2 of your code there won't do anything (plus there is a syntax error :)).

    Do you mean you want to load the list of options from the data object for the row? If so, do you have a separate value for which items in the list are selected?

    Or is it something more like this that you are working with? If so, you can use field().update() to modify the data in the DataTable field. Call that in initEdit - for example:

    editor.on('initEdit', function () {
      var rowData = table.row({selected: true}).data();


Sign In or Register to comment.