Welcome to the nuBuilder Forums!

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

[Idea] Set Browse Column Widths Topic is solved

Questions related to customising nuBuilder Forte with JavaScript or PHP.
Post Reply
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

[Idea] Set Browse Column Widths

Unread post by toms »

Hi,

I was wondering if there was an easier way to set the column widths of a browse form.

This is what I've come up with: https://vimeo.com/269326214

What do you think? Feel free to modify and include it in nuBuilder.

Javascript, to be added to zzzzsys_form:

Code: Select all

    $('#title_zzzzsys_browse_sfsbr_width').css({
        "text-decoration": "underline",
        "text-decoration-style": "dashed",
        "color": "blue"
    });

    $('#title_zzzzsys_browse_sfsbr_width').click(function(e) {
        custSetBrowseColumnWidths();
    });

function custSetBrowseColumnWidths() {
   if (confirm("Copy Column Widths from the Browse Table (Overwrite existing values)?")) {
    var sf = nuSubformObject('zzzzsys_browse_sf');
    for (var i = 0; i < sf.rows.length; i++) {
        if (sf.deleted[i] == 0) {
            var c = $("div[id='nuBrowseTitle"+ i +"']", window.parent.document); 
            var w = c[0].style.width;
            $('#' + 'zzzzsys_browse_sf' + nuPad3(i) + 'sbr_width').val(w.replace('px', '')).change();
        }
    }
}
}
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: [Idea] Set Browse Column Widths

Unread post by admin »

toms,

No thanks mate.

Steven
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: [Idea] Set Browse Column Widths

Unread post by toms »

You can add a button instead of the href link. But anyway, I added the functionality in another way so that code won't disappear after an update. I find it very useful because it's much easier to set the desired column widths other than doing it the manual way.
Timo
Posts: 217
Joined: Thu Mar 15, 2018 9:26 pm
Has thanked: 1 time

Re: [Idea] Set Browse Column Widths

Unread post by Timo »

Thank you so much for sharing! That's always been a little tedious.
toms wrote: I added the functionality in another way so that code won't disappear after an update
How did you do it? Would you mind sharing it too?
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: [Idea] Set Browse Column Widths

Unread post by toms »

Timo, you're welcome! I'm glad that you like it.
Here you go: https://github.com/tomsx/nuBuilderForte ... nWidths.js
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: [Idea] Set Browse Column Widths

Unread post by admin »

.
alf1976
Posts: 75
Joined: Tue Dec 26, 2017 8:58 pm

Re: [Idea] Set Browse Column Widths

Unread post by alf1976 »

Hi Toms,

thank you for posting this. Its very useful.

Andrew
toms
Posts: 785
Joined: Sun Oct 14, 2018 11:25 am

Re: [Idea] Set Browse Column Widths

Unread post by toms »

alf1976 wrote:Hi Toms,

thank you for posting this. Its very useful.

Andrew
Thanks! I'm glad it's useful to you! BTW, There has been a small update
alf1976
Posts: 75
Joined: Tue Dec 26, 2017 8:58 pm

Re: [Idea] Set Browse Column Widths

Unread post by alf1976 »

Hi Toms,

Updated thanks.

I have alot of browse forms so this saves loads of time guessing column widths.

Andrew
admin
Site Admin
Posts: 2814
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 25 times

Re: [Idea] Set Browse Column Widths

Unread post by admin »

.
Post Reply