var bricks = window.bricks || {}; bricks.DataRow = class extends bricks.HBox { /* { toolbar:[ ] fields:[] css browserfields{ exclouded:[], cwidth:{ field:10, field2:11 } } editexclouded:[], header_css } */ constructor(opts){ super(opts); this.record_w = null; } render_header(){ this.render(true); } render_data(){ this.render(false); } render(header){ // this.build_toolbar(header); if (this.checkField){ var w; if (header){ w = new bricks.BlankIcon({}); } else { var v = 0 if (this.user_data){ v = this.user_data[this.checkField]; } w = new bricks.UiCheck({name:this.checkField,value:v}); w.bind('changed', this.get_check_state.bind(this)); } this.add_widget(w); } this.build_fields(header); } renew(record){ this.user_data = record; this.record_w.clear_widgets(); this._build_fields(false, this.record_w); } get_check_state(e){ var d = e.target.bricks_widget.getValue() this.user_data[this.checkField] = d[this.checkField]; this.dispatch('check_changed', this); } build_toolbar(header){ var tools = []; if (header){ if (this.toolbar){ this.toolbar.tools.forEach(t => { tools.push({name:'blankicon'}); }); } } else { if (this.toolbar){ this.toolbar.tools.forEach(t => { tools.push(t); }); } } var toolbar = bricks.extend({cwidth:2.5}, this.toolbar || {}); toolbar.tools = tools; var w = new bricks.IconBar(toolbar); this.add_widget(w); this.toolbar_w = w; this.event_names = [] for(var i=0;i