CodeCharge Studio
search Register Login  

Visual PHP Web Development

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

YesSoftware Forums -> Archive -> GotoCode Archive

 Several Columns Grid

Print topic Send  topic

Author Message
yakli
Posted: 06/09/2002, 6:34 PM

<p>http://www.gotocode.com/disc_viewt.asp?mid=11352&s_topic=column&

<p>http://www.gotocode.com/disc_viewt.asp?mid=5712

<p>After I saw these messages, I tried it to have 3x3 grid. (ASP With Template,CCS Beta 1.0.5.0)
<p>But, I couldn't. I am new for ASP and also CCS.

<p>My Code is here,

<p>Function NewGrid2_BeforeShowRow() 'NewGrid2_BeforeShowRow @72-BAA8BAE4

<p>'Custom Code @96-73254650
<p>' -------------------------
<p>Dim point
<p>point = i/3
<p>'response.write "i: "& i & " point: " & InStr(point, ",") & "<br>"

<p>if InStr(point, ",") = 0 then
<p>tpl.SetVar "open1","</tr><tr>"
<p>else
<p>tpl.SetVar "open1",""
<p>end if
<p>tpl.SetVar "Link1",CCToHTML("fldLink1")
<p>tpl.Parse "Grid NewGrid2", True

i = i+1
' -------------------------
'End Custom Code


<p>It gives this error;
<p>Error Type:
<p>Microsoft VBScript runtime (0x800A01C2)
<p>Wrong number of arguments or invalid property assignment: 'Tpl.Parse'
<p>/Default_events.asp, line 24

<p>And here is my edited HTML file;
<p><!-- BEGIN Grid NewGrid2 -->
<p> <table>
<p> <!-- BEGIN Row -->{open1}<td><a href="{Link1_Src}"><font <p>color="#0000ff" size="3">{Link1}</font></a></td>
<p> <!-- END Row -->
<p> </table>
<p> <!-- END Grid NewGrid2 -->


How can I solve this problem?? Thanks for all...
Kevin
Posted: 06/11/2002, 6:20 AM

Hi,
I see the example was created for CC. You that CC and CCS code are quite different, so you cannot just cut’n’paste it into CCS. It should be adapted. Quick tip: try to put template variable like {open} into similar place in html code and edit it the same way as in CC. Then create for Before Show event to assign value to point var:
Dim point
point = i/3

And place the rest code to Before Show row event, e.g.:
if InStr(point, ",") = 0 then
tpl.SetVar "open1","</tr><tr>"
else
tpl.SetVar "open1",""
end if

But I haven’t tried it, it’s just a suggestion
yakli
Posted: 06/11/2002, 6:03 PM

I got it :) Enjoy...


Everything is the same with the Elena’s example.
Firstly, place your grid in a table. Your grid must have no class, if not delete it from properties window. Set your Label’s or Link’s Data Control Sources and go to Live Page. If everything is OK, Place a new Link before your controls in grid but in the table. You can edit this in HTML page. After that, clear the <tr> and </tr> outside of your controls but inside of your table.Your HTML should be like that.

<table class="" border="1" cellspacing="1" cellpadding="5" width="100%">
<!-- BEGIN Row --><a href="{Link2_Src}">{Link2}</a>
<td nowrap class=""><a href="{Link1_Src}"><font color="#0000ff" size="3">{Link1}</font></a> ({Label1})</td>
!-- END Row -->
</table>

In the Design Page, click your Link and Set it’s Content to HTML from Text on the Properties Window. Go to the Events Tab and right click to the Before Show Event to add your Custom Code. After that, Code Page will be opened. Add the code;

Function NewGrid2_Link2_BeforeShow() 'NewGrid2_Link2_BeforeShow @98-408A7A84

'Custom Code @99-73254650
' -------------------------
Dim point
point = i/3
'response.write "i: "& i & " point: " & InStr(point, ",") & "<br>"
if InStr(point, ",") = 0 then
NewGrid2.link2.Value = "</tr><tr>"
else
NewGrid2.link2.Value = ""
end if
i = i+1
' -------------------------
'End Custom Code

and define Public i on the top of your page. Because; we want to count i and then change the value of our Link. If you want to check the value of i you can uncomma response.write line and can see the values on the top of your Header. Also, there is still a bug in this code. If you add a new table, grid, label or link into your page or your table, CCS automatically adds <tr> and </tr> tags to your HTML and you have to delete them again and again...

   


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

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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