Add a Table View Button - A little help soon please
Posted: 2020-05-06 10:58
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 isfunction 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?