This commit is contained in:
yumoqing 2024-05-21 18:56:27 +08:00
parent ce49858187
commit c3e8e499ac

View File

@ -88,8 +88,9 @@ bricks.TreeNode = class extends bricks.VBox {
this.trigle.bind('state_changed', this.toggleExpandCollapse.bind(this));
widget.add_widget(this.trigle);
}
if (this.tree.checkable){
this.check_w = new bricks.Check({name:'check'});
if (this.tree.checkField){
var v = this.user_data[this.tree.checkField];
this.check_w = new bricks.UiCheck({name:'check', value:v});
widget.add_widget(this.check_w);
this.check_w.bind('changed', this.tree.node_checked.bind(this.tree, this))
}
@ -388,12 +389,14 @@ bricks.Tree = class extends bricks.VScrollPanel {
async node_checked(node, event){
var cb = event.target.bricks_widget;
var stat = cb.getValue().check;
node.user_data[this.checkField] = stat;
var d = {
node:node,
data:node.getValue(),
id: node.get_id(),
check_stat:stat
}
console.log('value=', cb.getValue(), 'node=', node);
this.dispatch('check_changed', d);
}
node_info_log(event){