This topic is locked
[SOLVED]

  Foldable Section with Dynamic DIVs

12/21/2009 12:14:35 PM
PHPRunner General questions
G
gluckett author

Hi All,

I like the foldable section tutorial, it works great: http://www.xlinesoft.com/phprunner/docs/add_folding_section.htm
What I would like to know is how can I use a current field to name my DIV?
for example,
<DIV id="div{$KEYCOLUMN_value}" STYLE="display:none">
how would I get the KEYCOLUMN value within the DIV code? - note: I am working within the HTML editor in PHPRunner.
thanks

gordon

J
Jane 12/22/2009

Gordon,
what page have you added this code on?

G
gluckett author 12/22/2009

This is part of the parcel_list.php page. Basically, I have the records vertically and I want to fold up each table (record) - I want to dynamically rename the DIV tags that surround the table (or give the table a unique id) so that I can fold up each record individually.


Also, for clarification, my real goal is to name HTML objects on the page based on the database values.
For example in PHPRunner, in the HTML Visual Editor, I change the table tags to read:

<TABLE border=0 cellSpacing=0 cellPadding=3 width="100%" ID={$CID_PCL_value}>


But the result is the following:

<TABLE border=0 cellSpacing=0 cellPadding=3 width="100%" ID=<span id="ieditlink_add"></span><span id="add_CID_PCL">&nbsp;</span>>




Gordon,
what page have you added this code on?

J
Jane 12/23/2009

Gordon,
here is a sample:

<TABLE border=0 cellSpacing=0 cellPadding=3 width="100%" ID={$id_value}>


Then assign correct value in the List page: After record processed event:

$record["id_value"] = $data["CID_PCL"];
G
gluckett author 12/23/2009

Thanks Jane,

In PHPRunner it shows List page: After Record Processed, but the actual funtion is (function BeforeMoveNextList(&$data,&$row,$col)
Is this the correct function to put the

$record["id_value"] = $data["CID_PCL"];

within?
thanks

gordon
ps. This is what I have so far:

NOTE: $myTableID for each record in the list.



<TR {$rowattrs}>{BEGIN grid_record}

<TD style="VERTICAL-ALIGN: top">{BEGIN grid_vrecord}

<TABLE id="{$myTableID}" border=0 cellSpacing=0 cellPadding=3 width="100%">

<TBODY>

{BEGIN grid_recordheader}<TR class=blackshade>

<TD class=grid_recordheader colSpan=2><A

class=tablelinks>View


Then within the After Record Processed:



function BeforeMoveNextList(&$data,&$row,$col)

{

$record["myTableID"] = $data["CID_PCL"];


thanks but the result is that the myTableID keeps showing up blank for each row.

J
Jane 12/24/2009

Gordon,
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.

G
gluckett author 12/24/2009

Hi Jane,

ok I figured out the issue: I am using PHPRunner 5.0 not 5.2 -
So the function:

function BeforeMoveNextList(&$data,&$row,$col)



Passes the $col not the $record in your example....I have to use the $row instead. And it now works like you showed (once I replaced $record with $row).



function BeforeMoveNextList(&$data,&$row,$col)

{

$row["myTableID"] = $data["CID_PCL"];


thanks!
gordon



Gordon,
Please publish your project on Demo Account and open a ticket at http://support.xlinesoft.com sending a URL to your pages along with instructions on reproducing this error.