This commit is contained in:
yumoqing 2024-04-29 17:47:29 +08:00
parent 71cdf450b9
commit 6adcd1d730
2 changed files with 11 additions and 9 deletions

View File

@ -55,11 +55,11 @@ bricks.DataRow = class extends bricks.HBox {
}
if (header){
if (this.toolbar){
this.toolbar.tools.foreach(t => if (not reserved.includes(t.name)) tools.push({name:'blankicon'}));
this.toolbar.tools.forEach(t => if (not reserved.includes(t.name)) tools.push({name:'blankicon'}));
}
} else {
if (this.toolbar){
this.toolbar.tools.foreach(t => if (not reserved.includes(t.name)) tools.push(t));
this.toolbar.tools.forEach(t => if (not reserved.includes(t.name)) tools.push(t));
}
}
var toolbar = bricks.extend({cwidth:2.5}, this.toolbar || {});

View File

@ -10,20 +10,22 @@ bricks.Tabular = class extends DynamicAccordion {
var view = bricks.apply_data(this.record_View, record);
var dr = bricks.DataRow(view);
dr.render(this.editable, this.checkable, false);
dr.bind('update', this.update_record.bind(this, record, item));
dr.bind('delete', this.delete_record.bind(this, record, item));
for (e in dr.event_names){
dr.bind(e, this.record_event_handle.bind(this, record, item));
}
dr.bind('update', this.update_record.bind(this, dr, record));
dr.bind('delete', this.delete_record.bind(this, dr, record));
dr.event_names.forEach(e => {
dr.bind(e, this.record_event_handle.bind(this, record, dr, item));
});
return dr;
} else {
var view = bricks.apply_data(this.record_View, record);
var dr = bricks.DataRow(view);
dr.render(this.editable, this.checkable, true);
dr.bind('add', this.add_record.bind(this, record, item));
dr.bind('add', this.add_record.bind(this, dr, record));
return dr;
}
}
record_event_handle(record, row, item){
}
}