block in grid

Hi,

is possible to use blocks in the grid as with the form ?

I have one only long record and I need two or more row in one table ad example :

My Table
1field , 2field, 3field, 4field, 5 field, 6 field ecc…

In grid I need :

1st row : 1field, 2field, 3field
2st row : 4field, 5field, 6field

Thanks

Re: block in grid

I would create a custom view in the DB to perform this:

example:


SELECT id_user,user_name,"",FALSE AS is_child
FROM users
WHERE is_active = 1
UNION
SELECT id_user, first_name,last_name,TRUE AS is_child
FROM users
WHERE is_active = 1
ORDER BY id_user,is_child

You should be able to get away with not creating a unique key for the union record since it is the same record in the same table. It will always load the correct record.

Regards,
Scott.

Re: block in grid

It works, but if i have two db tables and I need that 1st row with record of the 1st table and 2st row with record of 2st table ? is possible ?

many thanks

Re: block in grid

Just change the id field to the related field in the child

(untested)


SELECT id,field1,field2,FALSE AS is_child
FROM table_a
WHERE is_active = 1
UNION
SELECT id_parent as id,field3,field4,TRUE AS is_child
FROM table_b
ORDER BY id,is_child

Regards,
Scott.