Page 1 of 1

[Idea] Set Browse Column Widths

Posted: Sat May 12, 2018 9:12 am
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();
        }
    }
}
}

Re: [Idea] Set Browse Column Widths

Posted: Sat May 12, 2018 2:37 pm
by admin
toms,

No thanks mate.

Steven

Re: [Idea] Set Browse Column Widths

Posted: Sat May 12, 2018 2:50 pm
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.

Re: [Idea] Set Browse Column Widths

Posted: Sat May 12, 2018 4:37 pm
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?

Re: [Idea] Set Browse Column Widths

Posted: Sat May 12, 2018 5:12 pm
by toms
Timo, you're welcome! I'm glad that you like it.
Here you go: https://github.com/tomsx/nuBuilderForte ... nWidths.js

Re: [Idea] Set Browse Column Widths

Posted: Sat May 12, 2018 9:29 pm
by admin
.

Re: [Idea] Set Browse Column Widths

Posted: Sat Aug 18, 2018 9:09 pm
by alf1976
Hi Toms,

thank you for posting this. Its very useful.

Andrew

Re: [Idea] Set Browse Column Widths

Posted: Mon Aug 20, 2018 1:04 pm
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

Re: [Idea] Set Browse Column Widths

Posted: Fri Aug 24, 2018 8:49 pm
by alf1976
Hi Toms,

Updated thanks.

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

Andrew

Re: [Idea] Set Browse Column Widths

Posted: Fri Aug 24, 2018 8:53 pm
by admin
.