https://dev.getmerit.xyz/fe/#mp-tab-admin-segments
When I select a cell in Pivot it goes gray but then "unselects". It worked before - i am not sure what changed. I even removed cellSelected event function
Actually the issue is that another component refreshes the pivot on click - sidebar.
How do i add an event to Sidebar that fires only once when it closes?
Hi Alex,
From the explanation, we understand that you want an event that would be triggered while closing the Sidebar component. In the Sidebar component, we have a close event that will trigger each time Sidebar gets closed.
Check the following API property:
https://ej2.syncfusion.com/documentation/api/sidebar/#close
We've included a sample with the Sidebar close event for your reference.
https://stackblitz.com/edit/c3vpd8?file=index.html,index.ts
Check out the shared details. If we misunderstood, please provide more information about the exact problem you're experiencing at your end, including code snippets.
Regards,
Rajeshkannah G
My sidebar also has close on document click property, so close triggers every click....
Alex, The close event of the Sidebar will trigger each time the component gets closed. Since you enabled the closeOnDocumentClick property, it will collapse the Sidebar on a click anywhere on the entire area. However, you can avoid this by preventing the Sidebar from closing on specific conditions by using the cancel argument within the close event. Check out the below code snippet.
|
function onClose(args): void { //Check whether the clicked item is a button or an icon. if ( args.event != null && (args.event.target.classList.contains('menu') || args.event.target.innerText == 'TOGGLE') ) { //Cancel Sidebar closing. args.cancel = true; } else { alert('Close event is triggered.'); } } |
Sample: https://stackblitz.com/edit/c3vpd8-oqqtk5?file=index.html,index.ts