[CLOSED] Can't use more than one button

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

[CLOSED] Can't use more than one button

Post by nycwebmaster » 2020-01-23 16:32

Hi,

Thank you for the Library..... I have a question though.... In the code below when I add it to the Event-tv.js it renders the 2 buttons but the link that it will go to is the same as the last link.... in other words if I even add another button it will show nice but all the buttons will go to the 3rd link


What do I have to do if I have more than one button and each button is separate?




jQuery(function(){
jQuery('#Filter').after('<button class="btn btn-warning" type="button" id="filter-button"><i class="glyphicon glyphicon glyphicon-link"></i> Go To - Event Dashboard</button>');
jQuery('button[id=filter-button]').click(function(){
window.location = 'dashboard-event-operations.php';
});
});



jQuery(function(){
jQuery('#Filter').after('<button class="btn btn-warning" type="button" id="filter-button"><i class="glyphicon glyphicon glyphicon-link"></i> Create a new event</button>');
jQuery('button[id=filter-button]').click(function(){
window.location = 'Event_view.php?addNew_x=1';
});
});

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Can't use more than one button

Post by jsetzer » 2020-01-23 16:37

Hi,
is your question related to AppGini Helper JavaScript Library or is it a Javascript question in general? I cannot see any AGH JS Lib function-call there.
Best,
Jan

---
AppGini 5.81.1094
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Re: Can't use more than one button

Post by nycwebmaster » 2020-01-23 17:39

related to AppGini Helper JavaScript Library ..... what am I missing?

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Can't use more than one button

Post by jsetzer » 2020-01-23 21:18

Can you please post the code from Events-tv.js.

If you want to add two or more buttons in table view, there should be at least two lines in TABLENAME-tv.js having .addButton(...) or .addLink(...). I can only help you if I can see your code. You can send me a PM if you like.

Best,
Jan
---
AppGini 5.81.1094
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

nycwebmaster
Veteran Member
Posts: 90
Joined: 2015-11-23 01:02

Re: Can't use more than one button

Post by nycwebmaster » 2020-01-23 23:22

That's all the code that I inserted in this case on the Events-tv.js that I have currently. I took the example from your plugin tutorial maybe I'm missing something but the code that I have If I use only one link it actually works nice, the problem is with 2 links it sends on both links to only one link which is the last url on the script.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Can't use more than one button

Post by jsetzer » 2020-01-24 05:57

Maybe I have missed something: Which plugin tutorial are you referring to? Please post the link!

Adding buttons or links to table view can be done with .addButton() and .addLink() functions described here:

https://appgini.bizzworxx.de/products/j ... able-view/
https://appgini.bizzworxx.de/products/j ... addbutton/
https://appgini.bizzworxx.de/products/j ... w/addlink/

There is sample code for both functions. You need a tv object and call one of these functions for every new button. The code you have listed does not contain any of these function calls. Instead, you are using jquery to create buttons, and on each new button you replace the function call of all existing buttons by the function call of the new (last) button. This gives exactly the result you are experiencing here.

If you want to use our library function, please use .addButton or .addLink as described in the links above.

Best,
Jan
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Can't use more than one button

Post by jsetzer » 2020-02-23 17:49

Did you fix the bugs? Or is this still open?
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply