Buy Now
Sign in

CC V4 RC2 fields in the header

bighen , April 13 2012
B
bighen
Hi,
I'm trying to create nice custom listing of 1-to-many record set.
Like:

school_id  school_name  class_id  class-name
1  Windsor Primary School  101  1a
1  Windsor Primary School  102  1b
1  Windsor Primary School  103  1c
1  Windsor Primary School  104  1d
1  Windsor Primary School  105  1e
2  Oxford Primary School  107  1z
2  Oxford Primary School  108  1b


I want to put the field (school_name) from main table in the header, but it does not work.
Ok, the problem is which record to pick to take the value
But with the filter 'school_id = 1' I have only one school_name.

First: is this by design that {field_name} does not work in the header ?
Second: I could see the data grid in the debugger display, so I could use PHP
to create proper header, though I did not find the name of the array debugger shows... What is the name? I don't want to waste my time debugging the scripts...

Regards
Henryk
GreyHead
Hi Henryk,

Sorry I don't understand your question - what do you want to have in the Header row? It doesn't make any sense to me to put an individual School name there.

And, yes, {field_name} only makes sense in the Body section of a listing.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
B
bighen
Hi Bob,
It does make sense.

The example table shows not-filtered record set.
For particular school I've got the same school name in all records of the query.

Anyway the engine processes the body section so why not to let it go through all sections...

Henryk
GreyHead
Hi Henryk,

Anyway the engine processes the body section so why not to let it go through all sections...
Because normally the field will have a different value for each row in the table so there isn't any particular value that makes sense in the header.

If you've used the school name as a filter then that value may well be available in the Header box. It was in CCv2; I don't know if the same is true in CCv4.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
admin
Hi Henryk,

Currently the records list can be found in the header under:

$form->data['connection_data']
OR
$form->data['MODEL_ID']


I don't think this was included in RC2 so you may need to wait for RC3, I'm doing my best to finish it ASAP, hopefully by Thursday or so.

Regards,
Max
Max
If your main question got answered then please mark the answer using the button!​
​Please let us know if you have any problems with the new forums text editor, we appreciate your feedback!
B
Bullfn33
"admin":
Currently the records list can be found in the header under:
$form->data['connection_data']
OR
$form->data['MODEL_ID']

Is this still the case? I tried the above and did not get anything to show up. I need to add the username of the user's data I have listed in the header box.

In the header box I tried
<?php echo $form->data['U']['username']; ?>


FWIW, I added U.username to the List View Fields box in Frontend List Setting > General tab.