sort data

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
utony
Veteran Member
Posts: 93
Joined: 2020-04-03 18:37

sort data

Post by utony » 2022-12-05 21:07

Does anyone know how to group the rows of data with a custom header for each group?

Example:
3 rows for 1-1-2022
3 rows for 1-5-2022
3 rows for 1-9-2022

I am looking to group the rows with a header for each date.

So something like this

header 1-1-2022
data
data
data
header 1-5-2022
data
data
data
header 1-9-2022
data
data
data

JEngels
Posts: 17
Joined: 2014-03-10 14:16
Location: Germany

Re: sort data

Post by JEngels » 2022-12-06 09:16

I think thats not to be achieved within AG standard environment.
Maybe seems to be a topic for the Report Plugin?

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

Re: sort data

Post by jsetzer » 2022-12-06 16:08

Maybe the (new) clientside grouping functionality for TableViews can help, which will be part of upcoming version of (commercial*) AppGini Helper Javascript Library:

chrome-2022-03-0000f.gif
chrome-2022-03-0000f.gif (135.62 KiB) Viewed 1604 times

You can see a multi-level nested grouping on multiple fields in the above screenrecording.

There is a first draft of docs here:
https://www.appgini.de/docs/Javascript- ... uping.html

Sample code

Code: Select all

jQuery(document).ready(function() {
    var tv = AppGiniHelper.tv;
    let group_by_currency = tv.groupBy("code").setText("Währung");

    // apply grouping after adding group-definition(s)
    tv.applyGrouping(true);
}
* Ahmed has explicitely allowed me to post this answer, allthough the named library is a commercial product. Commercial products shall not be advertised in this community forum due to a community member's complaint.
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: sort data

Post by jsetzer » 2022-12-06 19:07

By the way:
There is exactly one "date" field in the example above. Nevertheless, the grouping functionality resolves two levels from that one given date-information: Year and Month.

This means the grouping feature allows you to split single values into parts and build nested groups. This is useful for example for dates (as shown above) and also for strings like "ORDER221206-nnnnnn" which can be split into "ORDER" (voucher type), "22" (year), "12" (month) and "06" (day) using standard javascript string-functions.

Code: Select all

ORDER221206-nnnnnn
^    ^ ^ ^---- day
|    | +---- month
|    +---- year
type

This could result in a "tree" like this:

Code: Select all

+ INVOICE
- ORDER
  - 22
    - 12
       - 06
         ORDER221206-253623 ...
         ORDER221206-248122 ...
         ORDER221206-248097 ...
  + 21
  + 20
  + 19
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

utony
Veteran Member
Posts: 93
Joined: 2020-04-03 18:37

Re: sort data

Post by utony » 2022-12-08 07:22

SO COOL!!!!!!!!! I will dive in. Thanks -JS-

utony
Veteran Member
Posts: 93
Joined: 2020-04-03 18:37

Re: sort data

Post by utony » 2022-12-08 08:20

JS,

What file does this code need to go into?

TABLE-TV.js???????

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

Re: sort data

Post by jsetzer » 2022-12-08 10:27

Yes.

But did you read this feature will be part of NEXT version?
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: sort data

Post by jsetzer » 2022-12-08 12:46

utony wrote:
2022-12-08 08:20
TABLE-TV.js???????
By the way: don't use uppercase "-TV" in Linux operating systems. This will work in Windows but not in Linux.
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

utony
Veteran Member
Posts: 93
Joined: 2020-04-03 18:37

Re: sort data

Post by utony » 2022-12-08 22:13

No I missed that, I was too dang exited. Please let me know when released! Thank you Sir.

Post Reply