Adding a custom Tab
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Adding a custom Tab
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
Thanks in advance,
David
- Attachments
-
- DetailView.JPG (60.77 KiB) Viewed 8232 times
Re: Adding a custom Tab
Hi,
is the "Materials" Table related to the Quoting table, or do you just want to have a link to the Materials tableview?
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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
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
Thank you,
David
Re: Adding a custom Tab
Hi,
you can try
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.
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'));
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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
Thank you and I'll give it a shot this evening. Should this code go in the Hooks section?
David
David
Re: Adding a custom Tab
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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
Thank you sir! I'll let you know how it goes.
David
David
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
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
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 (158.18 KiB) Viewed 7932 times
-
- Screen2.JPG (40.94 KiB) Viewed 7932 times
-
- Screen1.JPG (126.43 KiB) Viewed 7932 times
Re: Adding a custom Tab
Sorry my mistake,
can you put the script in quoting-dv.js
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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
Tried it in the quoting-dv.js and still didn't show up. Weird, seems like that would work?
Re: Adding a custom Tab
Hi,
please try to wrap the code in
$j(function(){
<code>
}
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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
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);
})
$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);
})
Re: Adding a custom Tab
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'));
})
$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.
Re: Adding a custom Tab
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'))
})
$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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
Tried both, but neither would show the new link for some reason.
Thank you,
David
Thank you,
David
Re: Adding a custom Tab
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'));
})
$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.
-
- Veteran Member
- Posts: 101
- Joined: 2019-05-26 18:38
Re: Adding a custom Tab
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
Thanks again!
David