Page 1 of 1

Remove height row on a browse form

Posted: Fri Jun 16, 2023 7:24 am
by yvesf
Hello,

Is it possible to remove the height row on a specific browse form ?
I have a wysiwyg field in the edit form . I would like to see the full content of each record of the wysiwyg field in the browse form.
Many thanks,


Yves

Re: Remove height row on a browse form

Posted: Fri Jun 16, 2023 9:14 am
by kev1n
I think you'll need JavaScript to resize the rows.

Re: Remove height row on a browse form

Posted: Fri Jun 16, 2023 10:49 pm
by yvesf
Any idea about how to do that ?
Thanks

Yves

Re: Remove height row on a browse form

Posted: Mon Jun 19, 2023 10:35 am
by kev1n
The browseSetHeight() adjust the height and positioning of the rows/cells based on the height of the WYSIWYG content.

Code: Select all

function browseSetHeight(colWYSIWYG) {

    function rowBottom(row) {

        const prevCell = '#nucell_' + String(Number(row) - 1 + '_' + colWYSIWYG);
        prevHeight = $(prevCell).cssNumber('top') + $(prevCell).cssNumber('height');
        return prevHeight;

    }

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

        const $this = $(this);
        const row = $this.attr('data-nu-row');
        const wysiwygCell = $('#nucell_' + row + '_2');
        const contentHeight = wysiwygCell[0].scrollHeight;

        $this.height(contentHeight);

        if (row > 0) {
            prevHeight = rowBottom(row);
            $this.css('top', prevHeight);
        }

    })

    $('#nuBrowseFooter').css('top', 50 + rowBottom(nuCurrentProperties().row_height + 1));
}
E.g., set the row height, if the WYSIWYG content is in column 3 (columns start with index 0):

Code: Select all

browseSetHeight(2)

Re: Remove height row on a browse form

Posted: Sun Jul 16, 2023 9:28 am
by kev1n
Hi Yves,

I'm wondering if that helped.

Re: Remove height row on a browse form

Posted: Fri Jul 05, 2024 9:38 am
by jerante
Hi,

Sorry for asking this question but how do I use this browseSetHeight function? I added the function in the Setup and then in browse & Edit but still doesn't see that the row in the browse form with more data resizes the height. I called the function in the custom code both in (Browse & Edit and Browse) of the form.

Thanks