Adding a custom Tab

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Adding a custom Tab

Post by dharbitindy » 2019-11-14 20:42

Does anyone know how to add a custom Tab, or Button in the Detail View of a Child Table? Attached is a screen shot of what I'm trying to do.

Thanks in advance,
David
Attachments
DetailView.JPG
DetailView.JPG (60.77 KiB) Viewed 8223 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-17 14:09

Hi,

is the "Materials" Table related to the Quoting table, or do you just want to have a link to the Materials tableview?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-20 13:46

Yes, the Quoting table has a Lookup field from the Materials table (Matl Type above). It would be cool though to also know how to just have a link if they aren't related, but most importantly here is to just add a tab/link next to the already there Efficiency, Eng Chg Req, and Results tabs.

Thank you,
David

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-20 18:55

Hi,

you can try

Code: Select all

$j('#Efficiency_link').after($j('#Efficiency_link').clone().prop('id', 'Materials_link' ).attr("href", "materials_view.php").html($j('#IEfficiency_link').children().clone()).append(' Materials'));
This shall add a button to the materials TV.

Please check all names as I'm not sure which ones you use and if you have uppper or lowercase.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-20 19:31

Thank you and I'll give it a shot this evening. Should this code go in the Hooks section?

David

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-20 20:15

you can add the code through the quoting-tv.js file in the hooks section.
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-20 20:19

Thank you sir! I'll let you know how it goes.

David

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-21 02:24

Hello Pascal,

I did try this and didn't have any luck. I am attaching 3 screen shots to see if that helps.

Thanks again,
David
Attachments
Screen3.JPG
Screen3.JPG (158.18 KiB) Viewed 7923 times
Screen2.JPG
Screen2.JPG (40.94 KiB) Viewed 7923 times
Screen1.JPG
Screen1.JPG (126.43 KiB) Viewed 7923 times

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-21 18:50

Sorry my mistake,
can you put the script in quoting-dv.js
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-21 20:33

Tried it in the quoting-dv.js and still didn't show up. Weird, seems like that would work?

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-22 13:45

Hi,

please try to wrap the code in

$j(function(){
<code>
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-22 17:51

Oddly it is still not showing up...

$j(function(){
$j('#Efficiency_link').after($j('#Efficiency_link').clone().prop('id', 'Materials_link' ).attr("href", "materials_view.php").html($j('#IEfficiency_link').children().clone()).append(' Materials'));
} (Tried this with and without the Parenthesis and the above code is all one line)

$j(function(){

/* Set the following fields as read only to avoid user editing */
$j('#pph').prop('readonly', true);
$j('#sec_pph').prop('readonly', true);

})

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-22 19:02

Did you try

$j(function(){
$j('#Efficiency_link').after($j('#Efficiency_link').clone().prop('id', 'Materials_link' ).attr("href", "materials_view.php").html($j('#IEfficiency_link').children().clone()).append(' Materials'));
})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-22 19:13

Otherwise try

$j(function(){
$j('[id$=_link]:last').after($j('[id$=_link]:first').clone().prop('id', 'Materials_link' ).attr("href", "materials_view.php").text('new').html($j('[id$=_link]:first').children().clone()).append(' Materials'))
})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-22 19:34

Tried both, but neither would show the new link for some reason.

Thank you,
David

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Adding a custom Tab

Post by pbottcher » 2019-11-22 20:14

Ok, clarified the issue with David. The table is called differently, so the correct code to work is

$j(function(){
$j('#eff_link').after($j('#eff_link').clone().prop('id', 'Materials_link' ).attr("href", "materials_view.php").html($j('#eff_link').children().clone()).append(' Materials'));
})
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

dharbitindy
Veteran Member
Posts: 101
Joined: 2019-05-26 18:38

Re: Adding a custom Tab

Post by dharbitindy » 2019-11-24 00:15

As usual pböttcher is a genius! I had a table name that didn't match the name shown for cloning a link.

Thanks again!
David

Post Reply