gpt4 book ai didi

php - 数据表自动获取气泡编辑器(Laravel + Blades)的ad值

转载 作者:行者123 更新时间:2023-12-01 04:37:49 25 4
gpt4 key购买 nike

我使用 laravel 5.4 和 Blades + DataTables,我想使用 Bubble Editor(数据表),例如:https://editor.datatables.net/examples/bubble-editing/simple

但是我从 Blades 中获取我的 theads 名称,而不是从 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() )

关于php - 数据表自动获取气泡编辑器(Laravel + Blades)的ad值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46412336/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com