EntityGrid: dynamic button

21-11-2018
To add a button to a grid if it has rows ```typescript let grid = new admin.EntityGrid("amura.billing.product"}) let b = new S.Button(T("@@Test"), null, grid.buttons, () => console.log("click!")) grid.onLoad = table => { if (table.rows) { b.element.style.display = "" } else { b.element.style.display = "none" } } ``` Enable/disable it as needed: ```typescript grid.onLoad = table => { if (table.rows) { b.element.classList.remove("disabled") } else { b.element.classList.add("disabled") } } ```
Frontend EntityGrid

Amura