bootstrapTable-treeView
bootstrapTable-treeView copied to clipboard
getSelections取不到选中的child
$("#tableId").bootstrapTable("getSelections"); 取不到选中的child,调试发现,在js的on click监听事件中,勾选父节点,循环给子节点添加选中状态时,没有将子节点的0属性,设置为true。设置上后就可以取到数据了。 位于557行左右 $.each(child, function (i, c) { $.each(that.data, function (index, item) { if (item[that.options.treeId] == c[that.options.treeId]) { ------- -------> item[that.header.stateField] = checked ? true : false; item.checked = checked ? true : false; that.trigger(checked ? 'check' : 'uncheck', item, this); return; } }); });
谢谢