OPEN row child details in modal ?

OPEN row child details in modal ?

oh132oh132 Posts: 4Questions: 4Answers: 0
edited February 22 in Free community support

Hello,

I want to know if it's possible to open the row child details in modal ( like searchbuilder on button ) ?

Actually, the data is under the parent row but I need to open in 'floating modal

$('#data tbody').on('click', 'td.details-control', function () {
        var tr = $(this).closest('tr');
        var row = table.row( tr );
        var index = row.index();

        if ( row.child.isShown() ) {
          row.child.hide();
        }
        else {
          row.child( 
            '<table class="child_table" id="child_history'+index+'" cellpadding="5" cellspacing="0" border="0" style="padding-left:50px;">'+
                  '<thead><tr><th>action</th><th>action_time</th><th>name</th><th>field</th><th>old_value</th><th>new_value</th></tr></thead><tbody>' +
             '</tbody></table>').show();

          new DataTable('#child_history'+index, {
            ajax: '/api/cms/history/host/'+row.data().name,
            processing: true,
            serverSide: true,
            info: false,
            filter: false,
            columns: [
              { "data": "action" },
              { "data": "action_time" },
              { "data": "name" },
              { "data": "field" },
              { "data": "old_value" },
              { "data": "new_value" },
            ],
            destroy: true,
            scrollY: '400px'
          });
          row.child.show();
        }
      });

Any idea ?`

Answers

Sign In or Register to comment.