Stored Files browse form row height

Questions related to using nuBuilder Forte.

Stored Files browse form row height

Postby tonyd » Fri Mar 16, 2018 10:16 pm

I am trying to recreate the functionality seen in the "Files" button and table but I cannot figure out how to get my row height to change from a very thin 18px so users can see the 140px image. :cry:
TonyD
tonyd
 
Posts: 59
Joined: Mon Mar 05, 2018 3:08 am

Re: Stored Files browse form row height

Postby toms » Fri Mar 16, 2018 10:39 pm

This is the relevant code for the Browse Form:

Basically, an EMBED element is inserted into the cells that make the cells "grow".

Code: Select all
nuSetNoSearchColumns([2, 3]);

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

    var code = '#nucell_' + index + '_';
    window.nuImages[$(code + '0').text()] = $(code + '2').text();

});


if (nuFormType() == 'browse') {
    nuShowBrowseImages()
}

function nuShowBrowseImages() {

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

        var p = $(this).attr('id');
        var r = String(p).split('_')[1];
        var i = "nucell_" + r + "_2";
        var e = "nucell_" + r + "_3";
        var h = $('#' + i).html();

        if (h != '' && h !== undefined) {

            var ob = JSON.parse(h)
            var ty = ob.type;
            var ur = atob(ob.file);
            var x = document.createElement("EMBED");

            x.setAttribute("type", "embed" + i);
            x.setAttribute("type", ty);
            x.setAttribute("src", ur);
            x.setAttribute("width", "140px");
            x.setAttribute("height", "140px");

            $('#' + e).html('');
            document.getElementById(e).appendChild(x);
        }

    });
}
toms
toms
 
Posts: 411
Joined: Wed Nov 08, 2017 8:57 pm

Re: Stored Files browse form row height

Postby admin » Sat Mar 17, 2018 3:17 am

TonyD,

Is this what you mean?

https://wiki.nubuilder.net/nubuilderforte/index.php/Forms#Row_Height

row_height.PNG
row_height.PNG (7.04 KiB) Viewed 86 times


Steven
admin
Site Admin
 
Posts: 2483
Joined: Mon Jun 15, 2009 9:53 am

Re: Stored Files browse form row height

Postby tonyd » Sat Mar 17, 2018 5:22 am

Yes, Steven. That fixed the initial browse view, but not when used as a subform. I think I will have to add some code to work this one out.
TonyD
tonyd
 
Posts: 59
Joined: Mon Mar 05, 2018 3:08 am

Re: Stored Files browse form row height

Postby admin » Sat Mar 17, 2018 9:14 am

TonyD,

You can try changing the Subform Type from Grid to Edit.

https://wiki.nubuilder.net/nubuilderforte/index.php/Objects#Type_2


Steven
admin
Site Admin
 
Posts: 2483
Joined: Mon Jun 15, 2009 9:53 am

Re: Stored Files browse form row height

Postby tonyd » Sat Mar 17, 2018 10:37 pm

After finally realizing that my underlying edit form was in fact dictating the column dimensions of my subform (obvious, right? :roll: ), I finally got everything lined up just the way I wanted.

Thanks.
TonyD
tonyd
 
Posts: 59
Joined: Mon Mar 05, 2018 3:08 am

Re: Stored Files browse form row height

Postby admin » Sun Mar 18, 2018 2:17 am

Cool.
admin
Site Admin
 
Posts: 2483
Joined: Mon Jun 15, 2009 9:53 am


Return to General