Skip to content

getSelections取不到选中的child #19

@lisongl123

Description

@lisongl123

$("#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;
}
});
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions