Add a Table View Button - A little help soon please
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Add a Table View Button - A little help soon please
I have managed to add a "batch actions" button like shown in 1.png
function print_treatment_card(table_name, ids){
var url = 'treatment_card.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}
window.open(url);
}
I have tried using appgini JS library but it doesn't work.
function print_treatment_card(table_name, ids){
var url = 'treatment_card.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}
window.open(url);
}
jQuery(function () {
var tv = new AppGiniTableView();
tv.addButton(function (id)
{
print_treatment_card();
}, "print", "Treatment Card");
// "flash" is the name of the glyphicon
// "My function" is the button text
});
Can anyone please help me soon?
I want to add a button like shown in 2.png
The code I used in tablename-tv.js is
function print_treatment_card(table_name, ids){
var url = 'treatment_card.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}
window.open(url);
}
I have tried using appgini JS library but it doesn't work.
function print_treatment_card(table_name, ids){
var url = 'treatment_card.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}
window.open(url);
}
jQuery(function () {
var tv = new AppGiniTableView();
tv.addButton(function (id)
{
print_treatment_card();
}, "print", "Treatment Card");
// "flash" is the name of the glyphicon
// "My function" is the button text
});
Can anyone please help me soon?
Re: Add a Table View Button - A little help soon please
Hi,
your function call print_treatment_card(); does not send any parameter, but your function print_treatment_card(table_name, ids) requires two parameters "table_name", and "ids".
It seems you are mixing up AppGini batch actions and javascript function calls.
Regards,
Jan
your function call print_treatment_card(); does not send any parameter, but your function print_treatment_card(table_name, ids) requires two parameters "table_name", and "ids".
It seems you are mixing up AppGini batch actions and javascript function calls.
Regards,
Jan
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + all AppGini Helper tools
<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 readabilityAppGini 25.10 + all AppGini Helper tools
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Re: Add a Table View Button - A little help soon please
Thanks for the reply jsetzerjsetzer wrote: ↑2020-05-06 11:11Hi,
your function call print_treatment_card(); does not send any parameter, but your function print_treatment_card(table_name, ids) requires two parameters "table_name", and "ids".
It seems you are mixing up AppGini batch actions and javascript function calls.
Regards,
Jan
Even this didn't work
Can this be done with javascript function calls in another way?
jQuery(function () {
var tv = new AppGiniTableView();
tv.addButton(print_treatment_card(table_name, ids)
{
var url = 'treatment_card.php?table=' + table_name;
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids);
}
window.open(url);
}, "print", "Treatment Card");
// "flash" is the name of the glyphicon
// "My function" is the button text
});
Can this be done with javascript function calls in another way?
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Re: Add a Table View Button - A little help soon please
Somebody a little help please.....
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Re: Add a Table View Button - A little help soon please
Anybody a little hand for me please...........






-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Re: Add a Table View Button - A little help soon please
Somebody a little help please.....
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Re: Add a Table View Button - A little help soon please
Anybody a little hand for me please....
Re: Add a Table View Button - A little help soon please
I have explained everything you need here:
https://appgini.bizzworxx.de/appgini-he ... ngle-rows/
You only need soma basic Javascript knowledge to apply the code shown there to your specific function.
https://appgini.bizzworxx.de/appgini-he ... ngle-rows/
You only need soma basic Javascript knowledge to apply the code shown there to your specific function.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + all AppGini Helper tools
<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 readabilityAppGini 25.10 + all AppGini Helper tools
-
- AppGini Super Hero
- Posts: 121
- Joined: 2020-02-16 16:29
Re: Add a Table View Button - A little help soon please
Thank you so much jsetser.jsetzer wrote: ↑2020-05-08 09:59I have explained everything you need here:
https://appgini.bizzworxx.de/appgini-he ... ngle-rows/
You only need soma basic Javascript knowledge to apply the code shown there to your specific function.
You are a lifesaver.
I finally did that.