I have problem updating translated text generated from model.
I have configuration panel with number of rows. Each row is separated object, rows are stored as array in configuration object. Some rows have extended configuration available via dedicated dialog. Few extended settings are meant to be visible as text in configuration table column. To do so I have following markup in table cell:
<span if.bind="!row.address" t="config.rows.disabled">Disabled</span>
<span if.bind="row.address" t-params.bind="{row: row}" t="config.rows.extinfo">
Address: ${ row.address }, Command: ${ row.command }
</span>
Text in second span is only updated when extended dialog open and save changes if.bind=""
condition state. So to update table cell each time I make following hack:
private async extConfig(row: RowConfig) {
let result = await this.dialog.open({
viewModel: RowConfiguration,
model: { row: { ...row } }
}).whenClosed();
if (!result.wasCancelled) {
Object.assign(row, result.output);
let tmp = row.address;
if (tmp) {
row.address = null;
setTimeout(() => row.address = tmp, 100);
}
}
}
Any suggestion how to make it more cleanly?