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
|
|
|
|