Page 1 of 1

Adding Two Buttons to Table View

Posted: 2022-07-24 07:51
by mohamed
Hello,

I have created this BadIP-TV.js file in Hooks to run the two scripts, for the new created buttons in the Table View.

The problem both buttons run the same file http://WebSite/alerts/BadIP.php

Would you please assist with the Functions and IDs .. THANK YOU :roll:


BadIP-TV.js
jQuery(function(){
jQuery('#Filter').after('<button class="btn btn-default" type="button" id="filter-button"> Generate IP Groups</button>');
jQuery('button[id=filter-button]').click(function(){
window.location = 'http://WebSite/alerts/BadIPGroup.php';
});
});


jQuery(function(){
jQuery('#Filter').after('<button class="btn btn-default" type="button" id="filter-button"> Generate IPs</button>');
jQuery('button[id=filter-button]').click(function(){
window.location = 'http://WebSite/alerts/BadIP.php';
});
});

Re: Adding Two Buttons to Table View

Posted: 2022-07-24 15:13
by pbottcher
Hi,

please put you code in the code display. That makes it easier.

Try

Code: Select all

jQuery(function(){
  jQuery('#Filter').after('<button class="btn btn-default" type="button" id="filter-button-ipgroup"> Generate IP Groups</button>');
  jQuery('button[id=filter-button-ipgroup]').click(function(){
    window.location = 'http://WebSite/alerts/BadIPGroup.php';
  });
});


jQuery(function(){
  jQuery('#Filter').after('<button class="btn btn-default" type="button" id="filter-button-ip"> Generate IPs</button>');
  jQuery('button[id=filter-button-ip]').click(function(){
    window.location = 'http://WebSite/alerts/BadIP.php';
  });
});

Re: Adding Two Buttons to Table View

Posted: 2022-07-25 05:33
by mohamed
Hi pböttcher,

Great, THANKS FOR YOUR HELP 8-)
so, the idential IDs was the cause, and I must use unique IDs

Sure, next time will use inlinecode to post the code.


I am wondering, What is the best Reference or Documentation of AppGini Functions and Variables ?


Thanks again ..