Pizza Tutorial missing in video

Questions related to using nuBuilder Forte.

Re: Pizza Tutorial missing in video

Unread postby apmuthu » Sun Jan 03, 2021 1:01 am

@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?
Attachments
Zero_Width_of_Description.png
Zero_Width_of_Description.png (42.54 KiB) Viewed 397 times
apmuthu
 
Posts: 249
Joined: Sun Dec 06, 2020 3:20 pm
Location: Chennai, India, Singapore

Re: Pizza Tutorial missing in video

Unread postby kev1n » Sun Jan 03, 2021 3:33 am

Implemented in Dev:
Attachments
lookup_width.gif
lookup_width.gif (357.27 KiB) Viewed 396 times
kev1n
nuBuilder Team
 
Posts: 1696
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: Pizza Tutorial missing in video

Unread postby apmuthu » Sun Jan 03, 2021 5:27 pm

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
apmuthu
 
Posts: 249
Joined: Sun Dec 06, 2020 3:20 pm
Location: Chennai, India, Singapore

Re: Pizza Tutorial missing in video

Unread postby apmuthu » Wed Jan 13, 2021 10:17 pm

Backported Zero Width when Code and Description are the same in nubuilder 4.
https://wiki.nubuilder.net/nubuilderfor ... _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
apmuthu
 
Posts: 249
Joined: Sun Dec 06, 2020 3:20 pm
Location: Chennai, India, Singapore

Re: Pizza Tutorial missing in video

Unread postby apmuthu » Thu Jan 14, 2021 3:32 am

The above post is erroneous in some aspects.

Backported Zero Width when Code and Description are the same in nubuilder 4.
https://wiki.nubuilder.net/nubuilderfor ... _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()
apmuthu
 
Posts: 249
Joined: Sun Dec 06, 2020 3:20 pm
Location: Chennai, India, Singapore

Previous

Return to General

Who is online

Users browsing this forum: No registered users and 23 guests