Datatables 自动获取 Bubble Editor (Laravel + Blades) 的广告值

Datatables automatic get thead values for Bubble Editor (Laravel + Blades)

我将 laravel 5.4 与 Blades + DataTables 一起使用,我想使用气泡编辑器(数据表),例如:https://editor.datatables.net/examples/bubble-editing/simple

但我的 theads 名字来自 Blades 而不是 json。我怎样才能得到这样的气泡编辑器?

    <table id="main_grid" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
        <thead id='main_grid_thead'>
            <tr>
                @foreach($tablefields as $field)
                    <th>{{ $field['detail_field']['grid']['label'] }}</th>
                @endforeach
            </tr>
        </thead>
        <tbody>
            <!-- TABLE BODY HERE-->
        </tbody>
    </table>

我得到了一个带有数据表的 JS 函数

var editor = new  $.fn.dataTable.Editor( {
        ajax: "../php/staff.php",
        table: '#'+id_grid
      });

  $('#'+id_grid).dataTable({
          sInfo: '',
          "sDom": '<"html5buttons"B><"top"fZ>rt<"bottom"lpi><"clear"> ',
          "oListNav": {
                    //SOME CODE
            },
          pageLength: 10,
          responsive: true,

      });


  $('#' + id_grid).on( 'click', 'tbody td:not(:first-child)', function (e) {
          editor.bubble( $('#' + id_grid + ' tbody tr:first-child td:first-child') );
      } );

我找到了解决方案

$('#' + id_grid ).on( 'click', 'tbody td i', function (e) {
 $(this).parent().children('i').attr('style','display:none; float: right;')
  editor.bubble( $(this).parent() )