From Population Question

From Population Question

charbl68charbl68 Posts: 2Questions: 0Answers: 0
edited September 2012 in Editor
Can I do this? I have a datatable that is populated with the fnAddData method and I want to use Editor ... but there is much more data needed to populate the form. I want to (or have Editor) do an Ajax call with the record ID to fetch the record information and have Editor use this data set to build and populate the form.

Replies

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin
    Yes it is possible to do that, however I would advocate a method like this instead: http://editor.datatables.net/release/DataTables/extras/Editor/examples/formOnlyData.html . Here the data source object for each table row contains the information for Editor and the DataTable, with each picking what it wants from the data source (it can overlap like in my example, but it doesn't need to). If that works for you, I'd really suggest doing that - otherwise what you can do is use the Editor API, specifically the `set` method to set the values of the fields, based on the Ajax return from the server.

    Regards,
    Allan
This discussion has been closed.