# Plugin for custom action (on database)

**URL:** <https://kanboard.discourse.group/t/plugin-for-custom-action-on-database/3332>\
**Category:** Questions\
**Created:** [December 5, 2024, 8:12pm UTC](https://kanboard.discourse.group/t/plugin-for-custom-action-on-database/3332 "2024-12-05T20:12:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloter](https://avatars.discourse-cdn.com/v4/letter/c/858c86/32.png) [@cloter](https://kanboard.discourse.group/u/cloter)\
**Post date:** [December 5, 2024, 8:12pm UTC](https://kanboard.discourse.group/t/plugin-for-custom-action-on-database/3332/1 "2024-12-05T20:12:09Z")

</div>

I’m trying to develop a plugin that will perform a very simple database action. For now the plugin puts an option on the card sidemenu that, upon selection, tries to show some data thru a javascript popup. (I’m past the problem of trying to use “onclick=” and implemented a listener instead).  
But when I click, nothing happens. What I can say is that the function is not being called.

Of course, I must be doing something wrong, but I really need this functionality for my project, so I’ll be very thankful for any help on this.

The code is at:

> **[GitHub - cloter/KB-CardSetBox-plugin: A KB CardSetBox plugin](https://github.com/cloter/KB-CardSetBox-plugin)**
>
> A KB CardSetBox plugin

---

<div class="post-metadata">

**Author:** ![alfredb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/alfredb/32/1051_2.png) [@alfredb](https://kanboard.discourse.group/u/alfredb)\
**Post date:** [December 5, 2024, 10:38pm UTC](https://kanboard.discourse.group/t/plugin-for-custom-action-on-database/3332/2 "2024-12-05T22:38:12Z")

</div>

Your script does nothing but call the controller with the task ID. Why not do it directly from the template?

```auto
<li>
    <?= $this->url->icon('info-circle', t('Show Task Details'), 'TaskConnectController', 'show', array('task_id' => $task['id'])) ?>
</li>

```

In case you still want to use the script, I’d recommend using jQuery.

```javascript
$(function () {
    $('.task-connect-info').click(function(e){
        e.preventDefault();
        // ...
    })
}

```
