Detail view from detail tab

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: 427
Joined: 2015-04-27 21:18

Detail view from detail tab

Post by SkayyHH » 2020-08-10 16:08

Hello,

when I call up a detail view from a details tab, the scripts are not executed and the detail form is not formatted with script funktions. It still works on a normal detail view from called from the list view.

What i have to do?

Thanks very much,

Kai

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

Re: Detail view from detail tab

Post by jsetzer » 2020-08-10 16:26

... the scripts ...
Which scripts do not execute when you open a detail view from within a detail view?
Do you mean the scripts in TABLENAME-dv.js?


May I kindly ask you to check for errors in your console output and eliminate all Javascript errors first - if any. Also, as always, don't forget to clear browser cache on reload.

Usually this works pretty well, I'm doing this every day and I've just checked it:

mrM47wnfnB.gif
mrM47wnfnB.gif (194.79 KiB) Viewed 2575 times

As you can see even in modal popup the custom tabs have been rendered correctly.

Regards,
Jan
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: 427
Joined: 2015-04-27 21:18

Re: Detail view from detail tab

Post by SkayyHH » 2020-08-10 18:15

Hello Jan,

thanks very much for help.

Here my console messages:

AppGini Helper JavaScript Library AppGiniHelper.min.js:6:28494
PRE-RELEASE Version 2020.06.15.10 for testing purposes, only AppGiniHelper.min.js:6:28538
Copyright 2016-2020 bizzworxx.de. AppGiniHelper.min.js:6:28582
AppGiniHelper.min.js:6:29330
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
AppGini.detectContentEditableChanges common.js.php:1706:12

Here screenshots of the standard form and modal form:

http://managersystem.de/!/detail_form_modal.jpg
http://managersystem.de/!/detail_form.jpg

What I also noticed is that forms are also "compact", although I have not created a "tablename.js" file. Is this default if I have integrated the scripts via header?

Thanks very much, Kai

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

Re: Detail view from detail tab

Post by jsetzer » 2020-08-10 18:32

(1) Avoid duplicate initialization of AppGiniDetail view. Re-use Variables for example if you have already initialized dv in header, don't initialize DV again in -tv.js or -dv.js

(2) naming of hook files
tablename.js
Please check if you have named your hook files correctly. A js file named like this will not be included by default unless you care for include by yourself. Maybe you have missed "-dv"?

(3) in your error messages and warnings there is only one related to our lib. That warning is not critical. But it comes twice which leads me to the idea that you might have initialized dv twice.

(4) I have seen that you have integrated an iframe with another view. You should eliminate fancy stuff and narrow down your problem. Otherwise there may be cross-effects and you may not find the real reason

(5) please make use of [ code ] ... [ /code ] tags here. It will help others reading your post.

(6) header
Is this default if I have integrated the scripts via header
You should not integrate Scripts via header.php as this file will be overwritten next time. You can use hooks/header-extras.php. this works for me perfectly. But as mentioned before: avoid multiple initialization.

(7) lazy loading
Please note that some elements will be lazy loaded and therefore will not be loaded in hooks/header-extras.php and sometimes not even on document ready.
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: 427
Joined: 2015-04-27 21:18

Re: Detail view from detail tab

Post by SkayyHH » 2020-08-10 18:46

Hello Jan,

thanks much.

1.)

The code for this example is:

Code: Select all

var dv = new AppGiniDetailView();

new AppGiniLayout([6,6])
    .add(1, ["employee", "title", "priority"])
    .add(2, ["start_date", "end_date", "follow_up", "done_date", "quality"])
    .wrapLabels();
$j.ajax("ajax_check_login.php");

new AppGiniLayout([12])
    .add(1, ["notes"])
    .wrapLabels();
$j.ajax("ajax_check_login.php");

2.)
Filename is: Todo-dv.js

3.) No, see above

4.) I have no iframes or fancy stuff ;-) It is the modal form called from tab list. With litte CSS but not this problem.

5.) Thanks

6.) Sorry. I do that.

Thanks much, Kai

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

Re: Detail view from detail tab

Post by jsetzer » 2020-08-10 19:07

(1) why are you calling this twice?

Code: Select all

$j.ajax("ajax_check_login.php");
Should be enough as last statement in TABLENAME-dv.js. It is recommended if you dont' have calculated fields and if you don't have lookups, because in these scenarios there may be timing problems. But If you have lookups or calculated fields, this additional ajax call should not be required. Anyway, this will not be your bug.

(2) you have said that you have integrated "the scripts" in "header".
a) Do you mean hooks/header-extras.php or header.php or any other header?
b) still open: which scripts?

Anyway, please check if you have initialized dv twice. Something like the following code should not appear multiple times

Code: Select all

var dv = new AppGiniDetailView();
or

Code: Select all

new AppGiniDetailView(). [...]
(4) I'm pretty sure I have seen a warning about an iframe embedding an Employees-view. I must have dreamed this.
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: 427
Joined: 2015-04-27 21:18

Re: Detail view from detail tab

Post by SkayyHH » 2020-08-10 20:08

1) There is no reason. It comes from copying. I'm just trying out appgini to see if I can use it for myself or not. it has a lot of good things, but also a few things that i miss. Hopefully your script will help :-)

2) in the header via header-extras.php: <script src="hooks/AppGiniHelper.min.js"></script> . No other scripts.

i have initialized dv only once.

Thanks again, Kai

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

Re: Detail view from detail tab

Post by jsetzer » 2020-08-10 20:20

OK, let me summarize, and please verify my assumptions:

(1) you include AppGiniHelper.min.js in hooks/header-extras.php
(2) there is only one (1) initialization of new AppGiniDetailView() which means:
(2a) there is no initialization of new AppGiniDetailView() in header-extras.php
(2b) there is no initialization of new AppGiniDetailView() in footer-extras.php (???)
(2c) there is no initialization of new AppGiniDetailView() in TABLENAME-tv.js (???)
(2d) the only new AppGiniDetailView() is in TABLENAME-dv.js and it occurs only once
(3) this is your script hooks/Todo-dv.js

Code: Select all

var dv = new AppGiniDetailView();
new AppGiniLayout([6,6])
    .add(1, ["employee", "title", "priority"])
    .add(2, ["start_date", "end_date", "follow_up", "done_date", "quality"])
    .wrapLabels();
$j.ajax("ajax_check_login.php");
new AppGiniLayout([12])
    .add(1, ["notes"])
    .wrapLabels();
$j.ajax("ajax_check_login.php");
(4) your table name is Todo (with capital "T" and lower case "odo")
(5) the two-colum layout works in standard detail view
(6) two-colum layout does not work in modal (embedded) detail view when opened from a standard children tabs of a parent record's detail view
(7) there are no additional scripts or styles which could interfere with

Did I get you right?

Regards,
Jan
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: 427
Joined: 2015-04-27 21:18

SOLVED: Detail view from detail tab

Post by SkayyHH » 2020-08-10 20:56

Hello Jan,

thank you very much for your patience. I got it.

I looked for duplicate entries in the files. However, I once initiated AppGiniDetailView in header-extras.php for the positioning of the child links and then in the tablename-dv.js for other settings.

Deleted in the tablename-dv.js and it works :-)

So thanks again.

I actualy noticed 2 more things about your script. But I had already noted that.
- lookup fixes cause a delayed resizing
- text fields in tabs have no height

Are there any plans for updates to your scripts or additional, new scripts?

Best regards, Kai

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

Re: Detail view from detail tab

Post by jsetzer » 2020-08-11 00:47

So my first guess, multiple initialization, was the reason.
(1) Avoid duplicate initialization of AppGiniDetail view. Re-use Variables for example if you have already initialized dv in header, don't initialize DV again in -tv.js or -dv.js
Yes, there will be a new version in last quarter of 2020.

If you are interested I recommend following me on Twitter and reading my blog at https://appgini.bizzworxx.de. I regularly post news about upcoming features there as many of you know.
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