pr3mium
Posts: 31
|
| Posted: 05/30/2006, 4:25 AM |
|
I'm looking for solution how to hide/show part of the HTML code - for example 3 rows of a table in a columnar Grid (showing 1 record at a time).
I tried using the following:
<!-- BEGIN Row -->
..............
<!-- BEGIN HideThisPart -->
<tr class="Row">
<td colspan="2">Some text</td>
</tr>
<tr class="Row">
<td> </td>
<td>Some more text</td>
</tr>
<!-- END HideThisPart -->
..............
<!-- END Row -->
This just hides the part, if I look at the page.
I then wanted to show this part by using:
GRIDNAME.HideThisPart.visible = TRUE in BeforeShowRow event, but there is no such object as "HideThisPart".
How could I show and hide this block using some criteria defined in BeforeShowRow event?
|
 |
 |
Benjamin Krajmalnik
|
| Posted: 05/30/2006, 9:41 AM |
|
For this you probably need to use panels.
Under CCS2 I do this the har way, by calling a function which hides the
individual components.
"pr3mium" <pr3mium@forum.codecharge> wrote in message
news:6447c2bc1d1f4d@news.codecharge.com...
> I'm looking for solution how to hide/show part of the HTML code - for
> example 3
> rows of a table in a columnar Grid (showing 1 record at a time).
> I tried using the following:
>
>
> <!-- BEGIN Row -->
> .............
> <!-- BEGIN HideThisPart -->
> <tr class="Row">
> <td colspan="2">Some text</td>
> </tr>
> <tr class="Row">
> <td> </td>
> <td>Some more text</td>
> </tr>
> <!-- END HideThisPart -->
> .............
> <!-- END Row -->
>
>
> This just hides the part, if I look at the page.
> I then wanted to show this part by using:
> GRIDNAME.HideThisPart.visible = TRUE in BeforeShowRow event, but there is
> no
> such object as "HideThisPart".
>
> How could I show and hide this block using some criteria defined in
> BeforeShowRow event?
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
pr3mium
Posts: 31
|
| Posted: 05/30/2006, 10:05 PM |
|
Could you give me an example of how'd you show and hide panels?
Have been using CCS since the first version, but so far I have had no need for using them.
Currently I use CCS3.
|
 |
 |
marcwolf
Posts: 361
|
| Posted: 05/30/2006, 11:27 PM |
|
You can also use the TBODY tag to encapsulate table blocks.
This will work so long as the TBODY does not breal across the TR or TD.
Now - give the TBODY an ID so you can reference it and then access it using Styles.
<TBODY ID="Number1">
<TR><TD> Hi There </TD></TR>
</TBODY>
and then in Javascript
document.getElementById("Number1").style.display = 'none';
or
document.getElementById("Number1").style.display = 'block';
We use this to break up large forms into tabbed area's where each secion has it own TBODY and we use JS to hide/show various sections.
Hope this helps
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
pr3mium
Posts: 31
|
| Posted: 05/30/2006, 11:31 PM |
|
OK, I know about javascript solution, but the hiding/showing decision must be made on server (eg is the user an administrator or not). So I thought, it would be logical to use beforeShow event.
|
 |
 |
marcwolf
Posts: 361
|
| Posted: 05/30/2006, 11:38 PM |
|
Ok - so it is serverside.
You can use a few xxx.visible = true (or false), or use a panel.
I have not used a panel as yet but I have heard that they work very well.
Take Care
Dave
_________________
' Coding Coding Coding
Keep Those Keyboards Coding.
Raw Code!!!!!!!
|
 |
 |
peterr
Posts: 5971
|
| Posted: 05/30/2006, 11:46 PM |
|
pr3mium,
Please read the "HTML Snippet within a Panel" of the "Working with Panels" section of the documentation.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
pr3mium
Posts: 31
|
| Posted: 05/31/2006, 1:05 AM |
|
Thanks, peterr!
Sometimes it's useful to take a look at the docs :)
|
 |
 |
pr3mium
Posts: 31
|
| Posted: 05/31/2006, 1:11 AM |
|
One more question...
Is it possible to show/hide some part of HTML code inside a panel separately. So I can either hide the entire panel or hide just some part of that panel?
It seems like there can't be panel under a panel.
|
 |
 |