# Jsroot simple gui with custom buttons

**URL:** <https://root-forum.cern.ch/t/jsroot-simple-gui-with-custom-buttons/46151>\
**Category:** Newbie\
**Tags:** jsroot\
**Created:** [August 3, 2021, 3:11pm UTC](https://root-forum.cern.ch/t/jsroot-simple-gui-with-custom-buttons/46151 "2021-08-03T15:11:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndrejL](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/andrejl/32/23243_2.png) [@AndrejL](https://root-forum.cern.ch/u/AndrejL)\
**Post date:** [August 3, 2021, 3:11pm UTC](https://root-forum.cern.ch/t/jsroot-simple-gui-with-custom-buttons/46151/1 "2021-08-03T15:11:16Z")

</div>

Dear experts,

I would like to know how to add buttons with js functions to the jsroot open file page that you get when using JSROOT.buildGUI(“div”). Please see the image.

I am trying to use this example [JavaScript ROOT API examples](https://root.cern.ch/js/latest/api.htm#httpcontrol_c_default_page) that has some buttons with commands, but I don’t understand the rules for creating buttons and where the commands are executed.

![jsroot_gui](https://root-forum.cern.ch/uploads/default/original/3X/5/d/5dc212ad7ba607ff876259de029f6e09b2d74502.jpeg)

Cheers

---

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [August 4, 2021, 11:13am UTC](https://root-forum.cern.ch/t/jsroot-simple-gui-with-custom-buttons/46151/2 "2021-08-04T11:13:27Z")

</div>

The GUI is built [here](https://github.com/root-project/jsroot/blob/master/scripts/JSRoot.jq2d.js#L1182-L1192) and for example the command of the “Load” button executed [here](https://github.com/root-project/jsroot/blob/master/scripts/JSRoot.jq2d.js#L1182-L1192)  
But you can create your own html page, like [this one](https://bellenot.web.cern.ch/public/jsroot/event_display.html) for example

---

<div class="post-metadata">

**Author:** ![linev](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/l/2bfe46/32.png) [@linev](https://root-forum.cern.ch/u/linev)\
**Post date:** [August 10, 2021, 7:28pm UTC](https://root-forum.cern.ch/t/jsroot-simple-gui-with-custom-buttons/46151/3 "2021-08-10T19:28:52Z")

</div>

Hi,

It is not possible to add button at the place you want.  
At least now - one have to extend functionality.  
I can do it once I back from vacations begin of September.

You could try to use HierarchyPainter class as it shown in example:

[https://root.cern/js/latest/api.htm#custom\_html\_file\_hierarchy](https://root.cern/js/latest/api.htm#custom_html_file_hierarchy)

There you can construct any elements you need.

Regards,  
Sergey

---

<div class="post-metadata">

**Author:** ![AndrejL](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/andrejl/32/23243_2.png) [@AndrejL](https://root-forum.cern.ch/u/AndrejL)\
**Post date:** [August 13, 2021, 8:12am UTC](https://root-forum.cern.ch/t/jsroot-simple-gui-with-custom-buttons/46151/4 "2021-08-13T08:12:06Z")

</div>

Thanks for all your feedback. I will try to build it from scratch.

Cheers,  
Andrej
