back to top

Determining the Tab Height Using Client Side Scripting in the Infor CRM Web Client

I recently had a client ask to have a given control that existed on a tab in the web client to size to fit the height of the window. This seems relatively easy until you realize that the height of the tab area changes based on how tall the detail view is and how many smart parts are added to the configurable “middle pane” area of the web client. I was able to figure this out by using client side scripting.

Using jQuery I was able to locate two components on the page.
1) The tab strip itself. This is identified with a class and does not contain an actual ID.
2) The bottom footer where the user, time and logout button shows. This does contain an ID.

Infor CRM Activities Tab

To find the tab, which has just a class name, you can use this jquery snippet:

 var tabpos = $('.tws-main-section').position().top;

This uses jQuery to get the element and then returns the vertical pixel location of the tab strip using the postion().top function.

We can do something similar to find the position of the bottom footer. Since this one does have an ID, we can use a slightly different jQuery search:

 var footer = $('#MainFooter').position().top; 

With those to coordinates we can then determine the height of the tab area available to us. The numbers that are returned are based on the tops of each element so we need to account for the actual space of the tabs, as well as the header area of the tab control itself. Something like this seems to work well:

var tabheight = footer-tabpos-200;

Finally with that height we can then set some other control’s height to match that. We can use jQuery to find our control by ID and then set the height with code like this (in our case the control is named QFTextBox):

$('#" + QFTextBox.ClientID + "').height(tabheight);

Since we will use this a couple of times lets make this code into a function. Putting it all together looks like so:

function sizeControl() {
    var tabpos = $('.tws-main-section').position().top;
    var footer = $('#MainFooter').position().top;
    var tabheight = footer-tabpos-200;
    $('#" + QFTextBox.ClientID + "').height(tabheight);
}

Now that we have functional client side code, we need to wire this up so that it runs. it is important to run for 2 events. When the tab is selected, and when the browser resizes.

The easiest way to handle running the code when the tab is selected is to use the dojo ready function. Since the tabs utilize dojo this will allow our code to run after the DOM has been loaded.

require(['dojo/ready'], function(ready){
    ready(function(){
        sizeControl();
    });
});

To run the same code on the resize of the browser we can use the window.onresize event. To ensure this runs after the tab has been sized we will use the window.setTimeout function to delay for 300 milliseconds.

window.onresize  = function () { 
    window.clearTimeout(resizeTimeoutId);
    resizeTimeoutId = window.setTimeout('sizeControl();', 300);
}; 

Now all we need to do is wire this code up to our tab smart part and whenever the tab is viewed it will have the control within it sized to fit the available space.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos