Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selection/RowModel.mjs onRowClick: additionally respond according to key-press properties #5102

Open
gplanansky opened this issue Nov 19, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@gplanansky
Copy link
Contributor

gplanansky commented Nov 19, 2023

proposed feature enhancement:
Current selection/RowModel.mjs onClick fires select or deselect for all clicks, that is both simple clicks and and keypress click combos.

This feature enhancement provides for additional distinct actions, for clicks with alt, ctrl, meta and shift key presses, by firing 'altSelect', 'ctrlSelect', 'metaSelect' and 'shiftSelect' signals.

Motivation: the immediate motivation is to trigger a dialog to edit table row values,

proposed code

src/selection/RowModel.mjs line 121 ff

onRowClick(data) {
    let me   = this,
        node = RowModel.getRowNode(data.path),
        id   = node?.id,
        view = me.view,
        isSelected, record;

    if (! id) { return };

    record = view.store.getAt(VDomUtil.findVdomChild(view.vdom, id).index);

    if (data.altKey) {
        view.fire('altSelect', {data, record})
    } else if (data.ctrlKey ) {
        view.fire('ctrlSelect', {data, record})
    } else if (data.metaKey ) {
        view.fire('metaSelect', {data, record})
    } else if (data.shiftKey ) {
        view.fire('shiftSelect', {data, record})
    } else {
        me.toggleSelection(id);
        isSelected = me.isSelected(id);

        !isSelected && view.onDeselect?.(record);

        view.fire(isSelected ? 'select' : 'deselect', {
            record
        });
    }
}

comment
It is potentially useful to include both the click event data, and the record, in the fire signal payloads. However to avoid breaking things the above code does not change the payload of the original select and deselect signals.

Copy link

This issue is stale because it has been open for 90 days with no activity.

@github-actions github-actions bot added the stale label Aug 29, 2024
@gplanansky
Copy link
Contributor Author

I still need this. Almost a year old.

@github-actions github-actions bot removed the stale label Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant