Closed webceoboy closed 1 month ago
通过看源码,发现动态生成的新行,没有绑定checkbox的点击事件, 而checkbox的点击事件是在table:loaded后才执行
因此添加一下代码即可
Grid::make(new TreeTable,function(Grid $grid){
$grid->id('ID')->bold()->sortable();
$grid->name->tree(); // 开启树状表格功能;
$id=$grid->getTableId();
$script = <<<JS
$('#$id').on('DOMSubtreeModified', function(){
console.log('changed')
$(this).trigger('table:loaded')
})
JS;
\Admin::script($script);
})
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Description:
Steps To Reproduce:
在form中使用selectTable, table中开启tree效果
默认是无法选中表格中动态添加的子行的,只能添加顶级的行