AppGiniHelper feature - dv.getChildrenTabs().sort()

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
balfons
Veteran Member
Posts: 91
Joined: 2018-10-22 15:27

AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by balfons » 2022-12-16 12:50

Hi everyone!

I trying this feature of the AppGiniHelper

Code: Select all

dv.getChildrenTabs().sort(["indicators", "cont_improv_nonconformities", "environmental_evaluation", "documents"], false, true);
but I'm not lucky. My child tables don't sort and the last one is activated by default. I tried to change the values of true and false but it didn't work.

I just followed the syntax of the changelog file:

Code: Select all

- NEW: dv.getChildrenTabs().sort( ["tablename1", "tablename2", "..."], true, true );
       parameters:
       (1) array of table names
       (2) boolean: auto activate first tab
       (3) boolean: auto hide tabs on load, then auto-show tabs after sorting
Any suggestion? Thanks!

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

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-16 13:48

Any errors im console? If any, fix them first.

Did you clear browser cache?

According to dev console, which version of AppGini and AppGini Helper JavaScript Library have been loaded?

Are you waiting for lazy loaded children tabs before trying to modify them?
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

balfons
Veteran Member
Posts: 91
Joined: 2018-10-22 15:27

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by balfons » 2022-12-16 15:29

Hi, Jan

There are no errors in console, I browse privately and I put my code after defining all tabs:

Code: Select all

var tabn = dv.addTab( "trazabilidad", "Trazabilidad", "erase")
	.add (["log_date", "log_creator", "log_last_update", "log_last_editor"]);
			
var tabx = dv.getChildrenTabs();
tabx.hide("environmental_evaluation", "environmental_aspect");

tabx.sort(["indicators", "cont_improv_nonconformities", "environmental_evaluation", "documents"], false, true);
Thanks!

balfons
Veteran Member
Posts: 91
Joined: 2018-10-22 15:27

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by balfons » 2022-12-16 15:38

Sorry, I forgot the AppGiniHelper version:

AppGini Helper JavaScript Library
AppGiniHelper.min.js:7 Version 2021.07.29.1

Thanks,

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

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-16 15:45

Ok, this is an old version.
Latest is 2022.12.9.
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: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-16 19:00

I've tested with latest version:

Default order of children tabs:
  1. orders
  2. contacts
  3. contracts
  4. notes
maskY4JQdg.png
maskY4JQdg.png (7.73 KiB) Viewed 4548 times

Code in hooks/TABLENAE-dv.js:

Code: Select all

var dv = AppGiniHelper.dv;
dv.getChildrenTabs().sort(['contacts', 'contracts', 'orders']);
Reload browser without cache:
SzYLShCelq.png
SzYLShCelq.png (7.97 KiB) Viewed 4548 times
Differently ordered tabs in order of the array entries in sort()-function call.
  1. contacts
  2. contracts
  3. orders
  4. notes
Re-Arranging should work in latest version.

For the other two options I will have to check library code. There may be racing-condition issues.
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: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-16 19:17

For activating one of the existing tabs you can use .activate("TABLENAME") function:

Code: Select all

AppGiniHelper.DV.getChildrenTabs().activate("notes");
AiZWVKIlDj.png
AiZWVKIlDj.png (6.82 KiB) Viewed 4548 times
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: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-16 19:25

The autohide parameter seems to work as designed:
  • If true, the childrenTabs will be hidden immediately after (first) appearance, then tabs are rearranged, then tabs are shown.
  • If false, they will be visible all the time and users can see re-arrangement which may take a second or so.
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
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by D Oliveira » 2022-12-20 14:53

It's a bit off topic but I'm not particularly a fan of the bottom panel for children tables, in my workflow I usually hide the whole panel and insert each table block in the section that pertains that information, otherwise you have to keep scrolling up and down to access it.

Usually I create a checkbox field to work as an anchor and then place the table after it.

Here's a snippet:

Code: Select all

        $j('#COMMENTS_TABLE').prop('checked', true);
        $j('#COMMENTS_TABLE').prop('disabled', true);

        $j('.children-tabs').hide();
        
        $j('#panel_comments-table_wbothers').show();
        //$j('#panel_comments-table_wbothers').hide();
        
        $j('#panel_comments-table_wbothers').insertAfter('#COMMENTS_TABLE');

It's important to note you have to setup a timer or otherwise because the panel takes a while to load so your javascript may be overrule without async implementation

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

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-21 13:22

D Oliveira wrote:
2022-12-20 14:53
...I'm not particularly a fan of the bottom panel for children tables...
Just an info for those who are interested:
Next version of AppGini Helper Javascript Library will have a one-liner function...

Code: Select all

AppGiniHelper.dv.getChildrenTabs().toPanels();
... which will turn default children tabs ...

chrome_bFtDpm3Y9N.png
chrome_bFtDpm3Y9N.png (20.81 KiB) Viewed 4406 times

... into expandable panels...

chrome_LdWHvHTG0n.png
chrome_LdWHvHTG0n.png (3.6 KiB) Viewed 4406 times

... which will automatically save their state (expanded/collapsed) in browser's local storage and restore it on load ...

chrome_ue9QPDhc79.png
chrome_ue9QPDhc79.png (24.56 KiB) Viewed 4406 times
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
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by D Oliveira » 2022-12-21 19:46

jsetzer wrote:
2022-12-21 13:22
...Next version of AppGini Helper Javascript Library...
Very interesting, hopefully you can add a quick one-liner repositioning feature to this collapsable panels as well, I don't see Appgini heading towards the object oriented programming approach trend within the PHP world nowadays, I think it will solidify in terms of a framework so these new refreshments you're bringing with this major library update will definitely be a game changer to keep adding value to the environment.

Thanks for all these contributions.

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

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-21 19:56

Well, there is progress in Object Orientation in AppGini, but this is a long way because Ahmed has to keep backward compatibility with thousands of generated apps from the past. Anyone here who has had to maintain and service their own software for years or decades will understand what I mean. You cannot just start from scratch. This would mean that BigProf would lose many customers who were able to rely on a stable, functioning solution for years - even if generated code was mostly functional-programming, not object-oriented.

Personally, I am the absolute object-oriented freak and I wish we were able to override existing classes in a simple way. And yet I like to rely on the generated solid foundation.

In PHP I handle it like this:
My hooks are almost exclusively housed in their own (Object Oriented) classes. This means I am at least able to extend and reuse my own code in an object-oriented way. So, my apps are a mixture of generated (mostly) functional code and object-oriented custom code.

In Javascript it is a bit different: For simple interaction I am using functional Javascript code. But more and more I am programming object oriented Javascript code using TypeScript. I see some progress in my own clientside coding there. The same with CSS: More and more I am using .less instead of .css which gives much more options.

This is just my personal "Best Practice".
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
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by D Oliveira » 2022-12-21 20:47

I understand backwards compatibility is a major driver to sustain the business side of things, but that doesn't mean BigProf can't fork the project in light of the benefits and create a separate product even though I understand this would take tremendous effort and so far Appgini has been brilliant by delivering what it proposes. I just wonder the possibilites lol but thank you for sharing your work environment's best practices, we all developed our own ways to avoid redundancy inside the appgini framework, I remember creating an unnecessary amount of ajax files to handle different requests when I was first starting out and I convinced myself that was worth the time given that Appgini handles most of the migration changes automatically so it just made sense to me to invest the time. Overall I think Appgini will still be useful, secure, and practical for many years ahead.

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

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by jsetzer » 2022-12-22 06:47

... but that doesn't mean BigProf can't fork the project in light of the benefits and create a separate product ...
Actually, at a sales prices of 79$ per unit (minus discounts minus fees minus taxes) I don't think BigProf can afford to double development cost for starting an OO-fork. I could not do that.
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
D Oliveira
AppGini Super Hero
AppGini Super Hero
Posts: 347
Joined: 2018-03-04 09:30
Location: David

Re: AppGiniHelper feature - dv.getChildrenTabs().sort()

Post by D Oliveira » 2022-12-22 23:59

jsetzer wrote:
2022-12-22 06:47
...I don't think BigProf can afford to double development cost...
$79 is just too cheap for what Appgini offers in my opinion, I would explore charging subscription options and raising the base price if that's what it takes to expand development, but yeah at the end of the day this is not my decision to make lol

Post Reply