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

Prevent event bubbling in cellClick listener #6353

Open
marciogurka opened this issue Mar 10, 2023 · 0 comments
Open

Prevent event bubbling in cellClick listener #6353

marciogurka opened this issue Mar 10, 2023 · 0 comments
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer OEM OEM customer

Comments

@marciogurka
Copy link

Forum post

Hello,

in Scheduler Pro I have the following features enabled:

[groupFeature] = "schedulerConfig.features.group"
[groupSummaryFeature] = "schedulerConfig.features.groupSummary"

In the group config I added edit-icon (class="tt-group-edit") to handle group edit process:

group: {
      field: 'group',
      renderer: ({isFirstColumn, count, groupRowFor, record}) => {
        if (isFirstColumn) {
          return StringHelper.xss`
                        <div class="tt-group-info">
                            <div class="name">${groupRowFor} (${count})</div>
                            <div class="title">${record.title}</div>
                        </div>
                        <div class="tt-group-edit"><i class="b-fa b-fa-pencil"></i></div>
                    `;
        } else {
          return '';
        }
      }
    }

For this edit-icon I defined the listener "cellClick":

listeners : {
      cellClick({ record, event }) {
        if (event.target.closest('.tt-group-edit')) {
          // TODO call Edit dialog here ...
          event.preventDefault();
          event.stopImmediatePropagation();
          event.stopPropagation();
        }
      },
    }

The problem is that collapse + expand still doing their work. But I want to prevent it when I click an action button / icon in this cell.
scheduler-group-click.PNG

@marciogurka marciogurka added bug Something isn't working forum Issues from forum large-account Reported by large customer OEM OEM customer labels Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer OEM OEM customer
Projects
None yet
Development

No branches or pull requests

1 participant