addLink to new tab

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
sgrzy01
Posts: 16
Joined: 2016-07-25 20:04

addLink to new tab

Post by sgrzy01 » 2021-11-08 13:45

Sorry if I'm missing something obvious, but is there a way with addLink, in the formation of the URL or other way that the called URL will open in a new tab?

Thanks!.

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

Re: addLink to new tab

Post by jsetzer » 2021-11-08 18:12

Sorry, I don't understand your request.
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

sgrzy01
Posts: 16
Joined: 2016-07-25 20:04

Re: addLink to new tab

Post by sgrzy01 » 2021-11-08 18:42

Sorry,

I'm using the addlink function to add a button to launch a custom page from the table view. Currently it opens in the current tab, I like to know if I could have it open in a new tab... basically add a target="_blank" to the url

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

Re: addLink to new tab

Post by jsetzer » 2021-11-08 20:55

(1) You can use addButton and open in new tab using javascript code
(2) will be back at the office on Wednesday. Then I will check if there is an additional parameter for target in addLink function
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: addLink to new tab

Post by jsetzer » 2021-11-24 07:05

Sorry for the long delay, I have taken a look at the sources for .addLink()-method of AppGiniHelper.TV-class.

In latest version there is a 6th parameter for target:

Syntax

Code: Select all

AppGiniHelper.TV.addLink(href, icon, text, Variation.default, prompt, target, onBeforeRender)
Example

Code: Select all

// file: hooks/TABLENAME-tv.js
jQuery(document).ready(function(){
    var tv = AppGiniHelper.TV;
    tv.addLink("my_custom_page.php", "flash", "Open My Custom Page", Variation.primary, "Are you sure?", "_blank");
});
target-Parameter
  • _self
    (default) Opens the given href in same tab
  • _blank
    Opens the given href in a new tab
  • myTabName
    (any string) Opens the given href in a new tab or existing tab, if already exists
  • null
    Evaluates to "_self"
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

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: addLink to new tab

Post by grimblefritz » 2022-04-14 21:43

A little late to resurrect a thread, but related:

Is there a reference somewhere that shows and explains available functions and parameters?

With the js minified, and the online documentation being somewhat lacking, it is a little bit of a chore to suss out the details at times.

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

Re: addLink to new tab

Post by jsetzer » 2022-04-14 22:01

Hi, if there is anything missing in the docs, please tell me and I will try to add asap.

Additionally, if you have questions concerning functions or parameters just send an email with your latest ordernumber to [email protected]. Usually I answer support requests the same day.
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

grimblefritz
AppGini Super Hero
AppGini Super Hero
Posts: 336
Joined: 2015-12-23 16:52

Re: addLink to new tab

Post by grimblefritz » 2022-04-22 19:35

Lacking, as in, where is the concise reference?

The case/example based documentation is ok for newbs, but it is cumbersome when trying to remember the name of a function or its parameters. This is more often the case when something is familiar, only the details are fuzzy.

BTW, AppGini itself is not much better in this regard. This page is about as close as it gets to a good reference. There are many other things AG provides in addition to what's on that page, and there are other lists, but finding it all can be an adventure. A single reference point would be a godsend.

The AG Helper libraries have the same situation. It's all there, but you have to spend time digging for it. Or build up your own reference via bookmarks. Futhermore, for people like me with memory problems, digging through the site takes a LOT longer than scanning a concise reference.

Anyway, didn't mean to knock on it as a product. It's capable. But it could use better reference material. In my opinion :)

If there's further discussion needed, we can take it offline or into a new thread.

Post Reply