Hi,
I have implemented a custom button using the actionbuttons.group.addbutton method. I need to hide it in some cases, once it is added how can I hide it?
Thanks.
~Paul
AG 5.84
Hide custom action button
Re: Hide custom action button
You can use the return value of addButton function:
Console output:
--
Later on, you can use the id for accessing the button by id:
PS: the id's will not persist between page loads
PPS: you can also get the id of the group and access the group element
Code: Select all
var dv = AppGiniHelper.dv;
var grp = dv.getActionButtons().addGroup("Group (1)");
var btn = grp.addButton("Button (1)", function (e) { /* your fn */ });
console.log("id of button: " + btn.id);
Console output:
--
Later on, you can use the id for accessing the button by id:
Code: Select all
var hide_button = true; // your condition
if (hide_button)
jQuery(`#${btn.id}`).hide();
PPS: you can also get the id of the group and access the group element
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + 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 24.10 Revision 1579 + all AppGini Helper tools
Re: Hide custom action button
Yes, string concatenation with + in javascript will work, too.
The `${variable}` notation seems new to many javascript developers. I don't see it very often. For me this is very useful and I got used to using that template-like string building instead of + concatenation.
The `${variable}` notation seems new to many javascript developers. I don't see it very often. For me this is very useful and I got used to using that template-like string building instead of + concatenation.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + 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 24.10 Revision 1579 + all AppGini Helper tools