Hide Add New Button

Is there a way to hide the add new button on a table component if after using the search component it returns any record. I use the search component to search fro a drivers phone number, if found I don want to leave the add new so they dont click on it and possibly create a new record.

Thank you.

Hi @remedina18 ,

Drop this CSS code in the page CSS.

/* Hide by default */
.table-outer-wrapper .t-new-record-button {
display: none !important;
}

/* Show ONLY when the empty-state is visible */
.table-outer-wrapper:has(.tb-no-record-found:not(.ng-hide)) .t-new-record-button {
display: inline-block !important;
}

Colin

Hi Col1n,

Thank you for the reply. I added the CSS but i see a red x on the left of line 6 it says

expected rparen at line 6, col 26.

no idea what that means.

I think Tadabase may use an older or limited version of CSS which throws an error (falsely). I’ve checked, and the code does work despite the warning.

Hi Col1n, you are correct. Sorry i didnt try before i replied.

Thanks