Page 1 of 1

sort data

Posted: 2022-12-05 21:07
by utony
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

Re: sort data

Posted: 2022-12-06 09:16
by JEngels
I think thats not to be achieved within AG standard environment.
Maybe seems to be a topic for the Report Plugin?

Re: sort data

Posted: 2022-12-06 16:08
by jsetzer
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 4963 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.

Re: sort data

Posted: 2022-12-06 19:07
by jsetzer
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

Re: sort data

Posted: 2022-12-08 07:22
by utony
SO COOL!!!!!!!!! I will dive in. Thanks -JS-

Re: sort data

Posted: 2022-12-08 08:20
by utony
JS,

What file does this code need to go into?

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

Re: sort data

Posted: 2022-12-08 10:27
by jsetzer
Yes.

But did you read this feature will be part of NEXT version?

Re: sort data

Posted: 2022-12-08 12:46
by jsetzer
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.

Re: sort data

Posted: 2022-12-08 22:13
by utony
No I missed that, I was too dang exited. Please let me know when released! Thank you Sir.