Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Install onClick event only for table headers #11

Open
alexandru-dinu opened this issue May 4, 2021 · 0 comments
Open

Install onClick event only for table headers #11

alexandru-dinu opened this issue May 4, 2021 · 0 comments
Assignees
Labels

Comments

@alexandru-dinu
Copy link
Owner

alexandru-dinu commented May 4, 2021

Current implementation:

function onClick(evt: MouseEvent): void {
    const htmlEl = (<HTMLInputElement>evt.target);
    
    const th = htmlEl.closest('thead th');
    
    // click was not performed in a table, exit
    if (th == null) { return; }
    
    // click was performed in a table
    // ...
}

Maybe it's better to do this rather than registering onClick events for all table headers in the current page?

@alexandru-dinu alexandru-dinu self-assigned this May 4, 2021
@alexandru-dinu alexandru-dinu removed their assignment May 31, 2021
@alexandru-dinu alexandru-dinu changed the title Install "onClick" event only for table headers Install onClick event only for table headers Jul 30, 2021
@alexandru-dinu alexandru-dinu self-assigned this Jul 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant