Page 2 of 2
Re: Pizza Tutorial missing in video
Posted: Sat Jan 02, 2021 4:31 pm
by apmuthu
@steven: Thanks.
This worked.
Can the code not be tweaked so that it is automatically set to 0 when the Code and Description fields are the same?
Re: Pizza Tutorial missing in video
Posted: Sat Jan 02, 2021 7:03 pm
by kev1n
Implemented in Dev:
Re: Pizza Tutorial missing in video
Posted: Sun Jan 03, 2021 8:57 am
by apmuthu
Actually the earlier
nuHide() does not work now due to some scope / visibility issue.
@kev1n: Your dev implementation on matching
code and
description to render the
width=0 is good. Also we need to make sure that after the
description is set, if the
code field changes, the logic should be applied again.
Point me to the actual code / db changes to implement it into the stable branch. This way we can gradually make it easier to understand and merge the newer changes later. Some changes like these generally should not be affected by the dev version dependencies.
Similar bunching and backporting of the following too may be in order - any issues there?
https://github.com/smalos/nubuilder4-De ... be010895ca
https://github.com/smalos/nubuilder4-De ... 9b9ac99c03
Re: Pizza Tutorial missing in video
Posted: Wed Jan 13, 2021 1:47 pm
by apmuthu
Backported Zero Width when Code and Description are the same in nuBuilder 4.
https://wiki.nubuilder.cloud/ ... _Width_Mod
Form ID:
nuform. Append this function in Custom Code. Of course, you could also write an sql query to do that.
Code: Select all
function nuSetLookupWidth() {
var w = $('#sob_lookup_description').val() == $('#sob_lookup_code').val() ? 0 : 150;
var cw = $('#sob_lookup_description_width').val();
if (cw == 0 || cw == 150 || w == 0) $('#sob_lookup_description_width').val(w).change();
}
Then, execute:
Code: Select all
INSERT INTO zzzzsys_event (zzzzsys_event_id, sev_zzzzsys_object_id, sev_event, sev_javascript) VALUES ('nu5ff0b31354688aa', 'nu5bad6cb32e1a66a', 'onchange', 'nuSetLookupWidth()');
INSERT INTO zzzzsys_event (zzzzsys_event_id, sev_zzzzsys_object_id, sev_event, sev_javascript) VALUES ('nu5ff0b329e242e25', 'nu5bad6cb32e47d18', 'onchange', 'nuSetLookupWidth()');
Verify if the objects with
nu5bad6cb32e1a66a and
nu5bad6cb32e47d18 exist first.
The above SQL can be entered in:
Code: Select all
Forms =>> nuform => Object List => Object: sfo_code => Input => doubleclick Input Type (and class) => Custom Code
Forms =>> nuform => Object List => Object: sfo_description => Input => doubleclick Input Type (and class) => Custom Code
Re: Pizza Tutorial missing in video
Posted: Wed Jan 13, 2021 7:02 pm
by apmuthu
The above post is erroneous in some aspects.
Backported Zero Width when Code and Description are the same in nuBuilder 4.
https://wiki.nubuilder.cloud/ ... _Width_Mod
Navigate to:
Code: Select all
Home => Forms => nuobject => Custom Code Append this function in the JavaScript pane:
function nuSetLookupWidth() {
var w = $('#sob_lookup_description').val() == $('#sob_lookup_code').val() ? 0 : 150;
var cw = $('#sob_lookup_description_width').val();
if (cw == 0 || cw == 150 || w == 0) $('#sob_lookup_description_width').val(w).change();
}
Of course, you could also write an sql query to do that.
Then, execute:
Code: Select all
INSERT INTO zzzzsys_event (zzzzsys_event_id, sev_zzzzsys_object_id, sev_event, sev_javascript) VALUES
('nu5ff0b31354688aa', 'nu5bad6cb32e1a66a', 'onchange', 'nuSetLookupWidth()');
INSERT INTO zzzzsys_event (zzzzsys_event_id, sev_zzzzsys_object_id, sev_event, sev_javascript) VALUES
('nu5ff0b329e242e25', 'nu5bad6cb32e47d18', 'onchange', 'nuSetLookupWidth()');
Verify if the objects with
nu5bad6cb32e1a66a and
nu5bad6cb32e47d18 exist first.
The above SQL can be entered in:
Code: Select all
Objects => sob_lookup_code => Custom Code => Event: onchange | Javascript: nuSetLookupWidth()
Objects => sob_lookup_description => Custom Code => Event: onchange | Javascript: nuSetLookupWidth()