Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

Hide column if form = iframe

Questions related to customising nuBuilder Forte with JavaScript or PHP.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Hide column if form = iframe

Unread post by kev1n »

Did you try this?
https://forums.nubuilder.cloud/viewtopic. ... =10#p20859

Just replace height with width

Code: Select all

$('body').css('width', '200px'); // reduce the body height
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Hide column if form = iframe

Unread post by kknm »

kev1n wrote:Did you try this?
https://forums.nubuilder.cloud/viewtopic. ... =10#p20859

Just replace height with width

Code: Select all

$('body').css('width', '200px'); // reduce the body height
Yes, the trick with width works, but it doesn’t work out with height. It is necessary to limit the number of lines in the iframe.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Hide column if form = iframe

Unread post by kknm »

It is desirable that the number of lines in the iframe be dynamic, i.e. the number of lines should be from the query result.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Hide column if form = iframe

Unread post by kev1n »

kknm wrote:It is desirable that the number of lines in the iframe be dynamic, i.e. the number of lines should be from the query result.
You mean that the blank rows should not be displayed ?
rows.jpg
You do not have the required permissions to view the files attached to this post.
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Hide column if form = iframe

Unread post by kknm »

kev1n wrote:
kknm wrote:It is desirable that the number of lines in the iframe be dynamic, i.e. the number of lines should be from the query result.
You mean that the blank rows should not be displayed ?
rows.jpg
Yes
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Hide column if form = iframe

Unread post by kev1n »

You are lucky.. I created such a function not so long ago. It may not be perfect, but it served its purpose. You may have to modify it a bit to suit your needs.

Code: Select all


function removeEmptyRows() {

    var lastRow;
    var r = 0;

    $('[data-nu-column="0"]').each(function(index) {

        var cellId = $(this).attr('id');
        var cellValue = $('#' + cellId).html();
        var rowNum = String(cellId).split('_')[1];

        if (cellValue === '') {
            $("div[id^='nucell_" + rowNum + "']").remove();
            r++;
        }

    });

    var t = $('#nuBrowseFooter').css('top').replace('px', '');
    $('#nuBrowseFooter').css('top', Number(t) - r * 23 + 20);

    var h = $('#nubody').css('height').replace('px', '');
    $('#nubody').css('height', Number(h) - r * 23 + 20);

}

removeEmptyRows();
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Hide column if form = iframe

Unread post by kev1n »

You can also do it with a one-liner

Code: Select all

   $('div[id^="nucell_"]').filter(':not([data-nu-primary-key])').remove();
kknm
Posts: 366
Joined: Sat Apr 11, 2020 12:03 am
Has thanked: 3 times
Been thanked: 4 times
Contact:

Re: Hide column if form = iframe

Unread post by kknm »

kev1n wrote:You can also do it with a one-liner

Code: Select all

   $('div[id^="nucell_"]').filter(':not([data-nu-primary-key])').remove();
I checked both methods, both clear empty lines, but do not solve the problem of right scrolling.
I note that explicitly indicating the number of lines on the browse tab removes the right scroll, but footer appears, which is not critical.
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Hide column if form = iframe

Unread post by kev1n »

The footer can easily removed with the JS:

Code: Select all

$('#nuBrowseFooter').remove();
kev1n
nuBuilder Team
Posts: 4416
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 74 times
Been thanked: 472 times
Contact:

Re: Hide column if form = iframe

Unread post by kev1n »

kknm wrote: I checked both methods, both clear empty lines, but do not solve the problem of right scrolling.
When does the horizontal scrollbar appear? I mean can't you just increase the width of the run object?
Post Reply