Based on the checked Field to determine whether it is selected
layui.config({ base: '/static/layui/' }).extend({ treeTable:
'treetable/treetable' }); layui.use(['treeTable'], function () { var $ = layui.
jquery; var treeTable = layui.treeTable; treeTable = $.extend(treeTable, {
config: { checkName: 'checked' } }); var insTb = treeTable.render({ elem:
'#demoTreeTb', height: '480px', tree: { iconIndex: 0, // In which column does the collapse icon appear isPidData:
true, // Is it id,pid Formal data idName: 'menuId', // id Field name pidName: 'parentId' //
pid Field name }, cols: [ { field: 'name', title: ' Node name ' }, { field: 'path', title:
' route ' }, { field: 'state', title: ' state ', templet: function (res) { if (res.state
== 0) { return ' disabled ' } else { return ' available ' } } }, { fixed: 'right', type:
'checkbox', width: 150 } ], reqData: function (data, callback) { //
Write it here ajax request , adopt callback Method callback data $.get('/system/resource/list', function (res) { if (
res.code == 0) { var data = res.data; for (var x in data) { console.log(data[x])
if (data[x].checked) { data[x]["LAY_CHECKED"] = 'true'; var index = res.data[x][
'LAY_TABLE_INDEX']; $('tr[data-index=' + index + '] input[type="checkbox"]').
prop('checked', true); $('tr[data-index=' + index + '] input[type="checkbox"]').
next().addClass('layui-form-checked'); } } callback(res.data); } else callback(
res.msg); }); } }); // Listen for line tool events treeTable.on('tool(demoTreeTb)', function (obj) {
var data = obj.data; var id = data.id; console.log(data.id) if (obj.event ===
'remove') { } else if (obj.event === 'edit') { } }); var checkStatus; // check box
treeTable.on('checkbox(demoTreeTb)', function (obj) { console.log(insTb.
checkStatus()); }); $("#save").click(function () { console.log(checkStatus); })
});

Technology
©2020 ioDraw All rights reserved
python gui Interface examples -Python GUI Programming complete example vue element-ui Drop down menu with search algorithm : Longest common subsequence ( Output all longest common subsequences ) First knowledge Mongdb Data query ( three ) The problem of time type conversion “2021-01-20T10:09:11Z” Morphological processing gradient , Top hat , Black hat mean value - Implementation and application of variance model _python_ Data analysis _9 Wechat small program student course selection system app Design CCF A series of questions --2016 year 4 Month 1 Calculation of break point laravel The first mock exam is based on the "one to many" model. with,has,wherehas