Console errors

This sub-forum is for discussing all topics related to AppGini Helper JavaScript Library, provided by bizzworxx as a third-party AppGini plugin.
Post Reply
SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Console errors

Post by SkayyHH » 2020-09-05 06:37

Hello Jan,

I get 2 console errors.

This is my code:

Code: Select all

 
 
 // ............ Layout ..................

new AppGiniLayout([6])
    .add(1, ["department"])
    .wrapLabels();

var row_1 = dv.addLayout([6,6])
    .add(1, ["#Stammdaten", "personnel_number", "first_name", "last_name", "date_of_birth", "gender", "marital_status", "children"])
    .add(2, ["# ", "job_title", "date_started", "termination_date"])
     .wrapLabels();

var row_2 = dv.addLayout([6,6])
    .add(1, ["#Kontaktdaten", "adress", "zip", "city", "country"])
    .add(2, ["# ", "phone", "mobile", "emergency_contact", "email"])
    .wrapLabels();

var row_3 = dv.addLayout([12])
    .add(1, ["#Notizen", "notes"])
    .wrapLabels();

dv.addTab("employee-tab", "Stammdaten", "calendar")
    .add(row_1);

dv.addTab("data-tab", "Kontaktdaten", "calendar")
    .add(row_2);

dv.addTab("notes-tab", "Notizen", "calendar")
    .add(row_3);

dv.getTabs().setPosition(TabPosition.Bottom);
dv.getField("department").insertBelow().hr();

new AppGiniField("department").dropdown().fix("pencil", "plus");

new AppGiniField("date_of_birth").toDatepicker();
new AppGiniField("date_started").toDatepicker();
new AppGiniField("termination_date").toDatepicker();

// ............ Minimum field entries ..................
$j("#first_name").attr("minlength", 3).attr("required", "required");
$j("#last_name").attr("minlength", 3).attr("required", "required");

// ............ Page Title ..................

var title_first_name = new AppGiniField("first_name").getValue(true);
var title_last_name = new AppGiniField("last_name").getValue(true);
dv.setTitle(title_first_name +" "+ title_last_name);


These are the displayed console errors:

AppGiniHelper | DefaultActionButtonContainer not found. / AppGiniHelper.min.js:6:38404
Mutations-Ereignisse sollten nicht mehr verwendet werden. Verwenden Sie MutationObserver stattdessen. / jquery-1.12.4.min.js:3:9646

Can you tell me what i did wrong?

Thank you very much,

Kai

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Console errors

Post by jsetzer » 2020-09-05 07:03

(2) The second message is not related to AppGini Helper Javascript Library.
  • Many times these are warnings raised by the browser itself or by browser extensions
  • AppGiniHelper warnings and errors should always have a prefix like "AppGiniHelper | ".
    Gonna focus on this for the next release and gonna double check that all warnings and errors will be prefixed like this. I'm almost sure they already are. Background-information: Prefixing the messages will help you narrowing down problems and will safe me time for reading, doing research and answering support request caused by different products.
  • If there is no such prefix, please post your bugreport in general section of this forum, if this is an AppGini warning/error or in the support forums of your browser- or browser-extension developers.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Console errors

Post by jsetzer » 2020-09-05 07:20

(1) Are you sure this is an error?

In sourcecode it is a warning only and therefore the message should not harm the rest of your code.

Explanation

That warning will be raised if you try to modify action buttons in detail view (buttons on the right hand side) but...
  1. they do not exist
    or
  2. they do not exists at that moment, yet, due to lazy loading.
Tip

You should check if an element "TABLENAME_dv_action_buttons" exists in your sourcecode. You can also check by using console in dev-tools.

chrome_2ckqx895IA.png
chrome_2ckqx895IA.png (2.03 KiB) Viewed 1740 times

Test in console

Code: Select all

$j("#TABLENAME_dv_action_buttons").length
...should return 1.

If it returns 1 in console but the warning still occurs at runtime, this could mean that you are initializing AppGiniDetailView object or try to modify action buttons too ealy.

As mentioned before in a different thread, you should avoid initializing AppGiniDetailView object too early or initialize multiple times (for example initialize for the first time in hooks/header-extras.php and then initialize for a second time in hooks/TABLENAME-dv.js.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Console errors

Post by SkayyHH » 2020-09-06 12:24

Thanks very much.

I'll take a closer look at it in the next few days.

AppGiniDetailView is only initialized once in header extras as you mentioned before.

Kai

SkayyHH
Veteran Member
Posts: 425
Joined: 2015-04-27 21:18

Re: Console errors

Post by SkayyHH » 2020-09-08 04:06

I tested that.

Code: Select all

$j("#TABLENAME_dv_action_buttons").length
is 1.

AppGiniDetailView object is only initialized once. You can see that in my code above.

The only action buttons are in your dropdown fix.

Code: Select all

new AppGiniField ("department"). dropdown (). fix ("pencil", "plus");
Thanks much, Kai

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: Console errors

Post by jsetzer » 2020-09-08 04:52

So, where is the problem right now? In dev-mode there is a warning which is not critical at all.

Maybe I did not understand if there is any question open.
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

Post Reply