# How to disable mouse right button click on Alarm Status Table component's header in perspective project?

**URL:** <https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [December 28, 2022, 5:17am UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013 "2022-12-28T05:17:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![UnSuk\_Song](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@UnSuk\_Song](https://forum.inductiveautomation.com/u/UnSuk_Song)\
**Post date:** [December 28, 2022, 5:17am UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013/1 "2022-12-28T05:17:29Z")

</div>

About Alarm Status Table component in Perspective,  
I want to use header of table then set 'enableHeader' to true.

But I want my client not to able to click this header with mouse right button to prevent them configuring columns.  
I don't want to expose the tag path with Display Path or Source column.

In this case, is it possible to do this?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [December 28, 2022, 6:09am UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013/2 "2022-12-28T06:09:28Z")

</div>

You should be able to set the css prop `pointer-events: none`. Just not sure where to put it without being at my laptop

---

<div class="post-metadata">

**Author:** ![UnSuk\_Song](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@UnSuk\_Song](https://forum.inductiveautomation.com/u/UnSuk_Song)\
**Post date:** [January 3, 2023, 3:47am UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013/3 "2023-01-03T03:47:36Z")

</div>

Thank you for your reply.  
I tried your solution, and checked that mouse click on table header is disabled.  
But, what I want to do is not to disable the left mouse click, but to disable the right mouse click only.  
I'll have to think of your solution as the next best thing and implement it.  
Thank you again.

---

<div class="post-metadata">

**Author:** ![UnSuk\_Song](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@UnSuk\_Song](https://forum.inductiveautomation.com/u/UnSuk_Song)\
**Post date:** [January 3, 2023, 7:14am UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013/4 "2023-01-03T07:14:54Z")

</div>

I resolved this problem by style injection(a.k.a css injection).  
The key is not to expose internal information of our system to customers by activating attributes(columns) such as 'Source' and 'Display Path'.

Of course I know that CSS injection is just a mimic, not a proper prescription.  
Just share the way of mimic.

1. Create style to be applied to Alarm Status Table component.  

2. Fill the property `background-color` with following value, click OK.

3. Apply the style to Alarm Status Table.

4. Done. You can both left and right click, but cannot see the alarm table configuration menu.

I'll check Ignition `v8.1.22` or later to try new feature further.

> [@New Stylesheet resource](https://forum.inductiveautomation.com/t/new-stylesheet-resource/64787):
>
> Starting with the 10/4/2022 Nightly (8.1.22) build, users will be able to modify a new styling resource: stylesheet.css This new resource is considered an advanced feature and will not be in place by default. To place the resource, expand the Perspective node of the Project Browser, right-click the Styles node, and select "Enable Advanced Stylesheet". [EnableStylesheet] Once in place, the stylesheet allows for inserting CSS just as you would in any normal CSS file. The rules defined in this r…

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [January 3, 2023, 3:38pm UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013/5 "2023-01-03T15:38:15Z")

</div>

Unfortunately, this approach will also probably impact other components. The Table, Video Player, and also the Alarm Journal Table use the contextMenuCommon class to render a context menu, and if you have any of those component present on the same page as the Alarm Status Table which has this workaround I would expect their context menus to stop working.

I don't see a better way to disable the header context-click column configurations, but you should be aware of the potential impacts of going this route.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [January 3, 2023, 3:52pm UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013/6 "2023-01-03T15:52:04Z")

</div>

i guessss you could mess yourway in with js-inject and remove the event listener of context menu only for that component its header/columns...  
Tho that kinda isnt 100% guarenteed to prevent them from triggerering it other ways, sinze it would be client site (just like the css pointer-events can be bypassed too) if they know how, atleast it will be hidden for common users

@UnSuk_Song im just out of holidays so i got a bunch of work piled up at the moment, ping me in 2 weeks if i didnt do anything yet xd

---

<div class="post-metadata">

**Author:** ![UnSuk\_Song](https://avatars.discourse-cdn.com/v4/letter/u/3ab097/32.png) [@UnSuk\_Song](https://forum.inductiveautomation.com/u/UnSuk_Song)\
**Post date:** [January 4, 2023, 1:35am UTC](https://forum.inductiveautomation.com/t/how-to-disable-mouse-right-button-click-on-alarm-status-table-components-header-in-perspective-project/68013/7 "2023-01-04T01:35:08Z")

</div>

Yes you're right.  
I have checked right away after I resolved the problem in this way.  
As you expected, all the components have name of selector `contextMenuCommon` has been affected by the style.  
Maybe I should apply it this way as a temporary measure.

Thank you for your concern.
