CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Custom Template with Object Inside

Print topic Send  topic

Author Message
CRandle

Posts: 1
Posted: 07/30/2004, 10:30 AM

Hi,

I'm using a custom template to hide a column in a grid based on userlevel. The column has a checkbox inside it.

Here's my html template:

<!-- BEGIN A_TD -->
<td class="KnockoutDataTD">
<p align="center"><input class="KnockoutInput" type="checkbox" value="1" name="{CheckBox2_Name}" {CheckBox2}></p>
</td>
<!-- END A_TD -->

Here's my relevant BeforShowRow code:

global $Tpl;

// if condition...{
$Tpl->SetBlockVar("A_TD","");
$Tpl->Parse("A_TD",true);
// }

I tried it without the SetBlockVar line and each new row in the grid would also contain all of the previous rows' checkboxes; forming an ever-growing pyramid.

My problem now is that the first row on my grid has no data. Here's the relevant code when I View Source on the published page:

row 1 checkbox:
<p align="center"><input class="KnockoutInput" type="checkbox" value="1" name="" ></p>

row 2 checkbox:
<p align="center"><input class="KnockoutInput" type="checkbox" value="1" name="CheckBox2_1" CHECKED></p>

The first row's checkbox is empty while the second one is named as if it's the first , the third is named for the second row and so on.

I've tried an example that I found on this forum, redirecting the block path, as in:

global $Tpl;

// if condition... {
$Tpl->SetBlockVar("A_TD","");
$oBlk=$Tpl->block_path; // Save the current path
$Tpl->Parse("A_TD",true);
$Tpl->block_path=$oBlk."/A_TD"; // Enter custom block
$Trucks->CheckBox2->Show(); // Force the render
$Tpl->block_path=$oBlk; // Reset the path
//}

But got the same results.

Thanks in advance
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.