# Regarding ui base .js

**URL:** <https://discourse.nodered.org/t/regarding-ui-base-js/93750>\
**Category:** Dashboard\
**Created:** [7 December 2024 04:46 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750 "2024-12-07T04:46:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Subavarsha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/subavarsha/32/92880_2.png) [@Subavarsha](https://discourse.nodered.org/u/Subavarsha)\
**Post date:** [7 December 2024 04:46 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750/1 "2024-12-07T04:46:29Z")

</div>

Hi  
I am trying to build an application using nodered  
where there will be 4 user one is admin and other three are user1, user2, user3 .  
Admin will be maintaining records of these 3 user like how many times these users have logged-in(count of login) in the table of the ui tabulator  
and other user1, user2, user3 will be having their own things in dashboard like screw gauge, map, slider different user different things  
this table is ui-tabulator from flowfuse dashboard  
now when i click that particular user like user3 in tabulator  
that particular user alone should go out from dashboard  
I know that for this we have to remove socket\_id of that particular user  
and i can clearly see the socket id of each user in ui\_base.js file  
now the thing is onclick of one cell in tabulator how can I activate or trigger the socket.disconnet(socketid) or socketid.disconnect present in the ui\_base.js file

I have also tried to use the function

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8ffe4f540b0886597124ebcc17fe12c9e41239bb.png)

and trying to export to call the function wherever i want

but as it is represented as function (RED) i could not export like other normal functions

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [7 December 2024 08:08 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750/2 "2024-12-07T08:08:04Z")

</div>

Just a thought: how about sending a message to a template node on the to-be-killed dashboard page, telling it to kill itself gracefully? (e.g. with a `window.close()` command)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [7 December 2024 09:16 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750/3 "2024-12-07T09:16:18Z")

</div>

> [@omrid](#):
>
> with a `window.close()` command

That only works if the window was "popped out" via JavaScript to start with (that is the simple explanation, search web for more detail). This is a security feature to prevent annoying sites messing with folk.

---

<div class="post-metadata">

**Author:** ![Subavarsha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/subavarsha/32/92880_2.png) [@Subavarsha](https://discourse.nodered.org/u/Subavarsha)\
**Post date:** [7 December 2024 09:20 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750/4 "2024-12-07T09:20:28Z")

</div>

window.close() is ok, but i want to close the window of particular user that i select from admin table where all users are listed. That is the issue sir

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [7 December 2024 21:26 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750/5 "2024-12-07T21:26:22Z")

</div>

Not sure I understand your issue, sir.  
Every user dashboard (1, 2, and 3) will have hidden ui-template which listens to messages. Suppose the admin decides to close the window of user 2, it will send a message with '2' in it. This message will be ignored by the windows of users 1 & 3, while the window of user 2 will use JS to close itself.

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [7 December 2024 21:33 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750/6 "2024-12-07T21:33:30Z")

</div>

> [@Steve-Mcl](#):
>
> That only works if the window was "popped out" via JavaScript to start with (that is the simple explanation, search web for more detail). This is a security feature to prevent annoying sites messing with folk.

Good point Steve. In cases where `window.close()` is blocked, we can try workarounds, such as preceding it with a dummy self-open

```auto
window.open('', '_self', '');
window.close();

```

or perhaps use iFrames.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [6 January 2025 21:33 UTC](https://discourse.nodered.org/t/regarding-ui-base-js/93750/7 "2025-01-06T21:33:38Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
