How to group records in Servoy table view or list view ?

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

How to group records in Servoy table view or list view ?

Postby ashutoslenka426 » Fri May 20, 2016 12:49 pm

Hi All ,

Is it possible to group records in Servoy table view or list view depending on a table field ? . I want to show some line kind of stuff under each group. Is it Possible ? . Please share your suggestion on this .
AL
ashutoslenka426
 
Posts: 295
Joined: Thu Jan 26, 2012 3:38 pm

Re: How to group records in Servoy table view or list view ?

Postby paronne » Mon May 23, 2016 1:33 pm

Hi, for which type of Servoy client you would like to achieve this ? is for NG Client or for Smart/Web Client ?
paronne
 
Posts: 203
Joined: Fri Nov 02, 2012 3:21 pm

Re: How to group records in Servoy table view or list view ?

Postby rodney » Thu May 26, 2016 8:15 am

Hi

I don't think this is possible in a foundset with a table view but we do this using the table bean plugin and a dataset to get a nice summary line within a table. Table bean is smart client only :cry:

screenshot.png
screenshot.png (13.46 KiB) Viewed 3696 times
rodney
 
Posts: 8
Joined: Wed Dec 02, 2015 8:04 am

Re: How to group records in Servoy table view or list view ?

Postby Bernd.N » Tue May 31, 2016 2:09 am

I think it is possible when you add two new fields to the table itself like
sequence (INT)
row_type (CHAR 1) -> G = Group Row, null = Normal Row
Then you can create and show a group line with the information you need, and use a special sort order to put the group row below the normal rows.

The group line could be shown in another color with an onRenderLine() function on each field.

In case you do not want that group line in the original table, you could create a temporary SELECT as you like and need, together with a UNION that adds the group lines, and convert that to a foundset and show it in the table form.

We used this approach to create a report of Top-Five-Sales-of-a-period for each branch of a customer, which had some additional lines below the top-5-lines, not only a summary. Then we just printed everything in the order we needed. Worked quite well with this approach.
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: How to group records in Servoy table view or list view ?

Postby Peter de Groot » Tue May 31, 2016 8:36 am

Hi,

Why don't you the solutionModel to create the list/table, I did something similar

2016-05-31_0833.png
2016-05-31_0833.png (21 KiB) Viewed 3578 times


Regards
User avatar
Peter de Groot
 
Posts: 215
Joined: Thu Jan 10, 2008 8:38 pm
Location: Not sure...

Re: How to group records in Servoy table view or list view ?

Postby patrick » Tue May 31, 2016 10:51 am

The table bean really shouldn't be used anymore. It's smart client only and there is no need for it anymore since the introduction of the solutionModel. I have written a replacement for the bean in JavaScript that is available here: https://github.com/Servoy/svyUtils. It's the svyUtils$tableGrid module. That is based on the solutionModel and will work in any client.
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 31 guests

cron