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();
}
}
}
}