Blog example, ajax loaded row details as new datatable/editor instance

Blog example, ajax loaded row details as new datatable/editor instance

crush123crush123 Posts: 417Questions: 126Answers: 18

Further to the blog entry https://datatables.net/blog/2017-03-31, i have created a parent/child row setup as orders/order details, so that the order details are loaded via ajax into a table in the child row.

http://test2.forthwebsolutions.com/hutch4dmin/orders.php

This works well, but the table ajax content is read only.

I would love to be able to load the order details as a datatable/editor so i can edit its content.

The blog post suggests this can be done, but I can't see an example - any help appreciated

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,691Questions: 1Answers: 10,500 Site admin
    Answer ✓

    There isn't an example provided of that - its an exercise left to the reader :smile:

    The success callback is where you would add any extra configuration. For example if json.html includes an HTML table you could simply do:

                div
                    .html( json.html )
                    .removeClass( 'loading' );
    
                div.find('table').DataTable();
    

    Allan

  • crush123crush123 Posts: 417Questions: 126Answers: 18

    I gotcha :#

    i am loading a json data object, exactly the same format as if it were a datatable source, and building the html table in javascript on the client side.

    not an expert at this, what i have works, so will make do wth a readonly version for now

This discussion has been closed.