CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge Studio -> IDE/GUI

 alternate record

Print topic Send  topic

Author Message
yelbuga

Posts: 7
Posted: 11/29/2004, 7:24 AM

hi,
how can show alternate record row in editible grid?

View profile  Send private message
Anton Hinxman
Posted: 12/14/2004, 11:01 AM

CCS Help 'Grid Builder'...

"Alternate records:"
" If this option is selected, every other record in the grid will appear in a row with a different background color than the preceding record. "

Is this what you want?

Anton
yelbuga

Posts: 7
Posted: 12/14/2004, 10:31 PM

sorry but not.
it's ok with the normal grid.
but the editible grid, there is no section like "alternate records".

my problem is this.
View profile  Send private message
roeya


Posts: 181
Posted: 12/16/2004, 1:17 AM

yelbuga hi,

You can add new label to the row, this label should not be connected to the database lets sat the label name is "row_style"

then in the row replace the class of every TD tag (e.g. class="MailboxDataTD" ) with the label

Add custom code for Before Show Row and incement global variable by one (smothing like "var_name++")

now add something like (this is Perl style but should look similiar in other languages)

$xxxxxxxxx->{"row_style"}->SetValue(var_name % 2 ? "MailboxDataTD" : "OtherStyle");

don't forget to define the OtherStyle in your style sheet...

If this seems complicated I can give an a example in Perl, but it will take several days before I have time to prepare it

Hope this help



_________________
http://www.infoneto.com/
View profile  Send private message
feha


Posts: 712
Posted: 12/21/2004, 2:21 AM

You can use this before show row event:
   global $Tpl;  
  global $tindex;  
  $tindex <= 0 ? $tindex = 1 : $tindex++;  
  ($tindex  % 2) == 1 ? $tclass = "VisionToDataTD" : $tclass = "VisionToAltDataTD";  
  $Tpl->SetVar("tclass",$tclass);
and edit HTML ...

  
        <!-- BEGIN Row -->  
          <tr>  
            <td class="{tclass}">{lang_flag}</td>   
            <td class="{tclass}"><strong></strong><a class="VisionToDataLink" href="{language_Src}"><strong>{language}</strong></a><strong></strong> </td>   
            <td class="{tclass}">{lang_order} </td>   
            <td class="{tclass}" align="right">{lang_active} </td>   
          </tr>  
 <!-- END Row -->  

This tips is from rexdesign.com [Dave]


_________________
Regards
feha

www.vision.to
feedpixel.com
View profile  Send private message
DaveRexel

Posts: 50
Posted: 12/21/2004, 12:29 PM

::
Thanks Feha,

The article can be read at
http://ccs.ath.cx/~ccs/kb.php?s_keyword=alt&event_id=82...7&language_id=7

BTW please take the time to visit Fehas site www.vision.to to see what a brilliant developer can do with CCS.
Dave

_________________
/Dave
RexDesign CodeCharge Studio Tutorials
http://rexdesign.com/ccs/
View profile  Send private message
yelbuga

Posts: 7
Posted: 12/21/2004, 10:44 PM

thanks a lot.
View profile  Send private message
bb
Posted: 12/31/2004, 1:29 PM

If you just want to change the attributes of the row items using PHP only, the following works (subject to a row item being selected).

Add a new item in the style sheet similar to that below based on the Clear theme:
.ClearSelectedDataTD
  
border-left: 0px solid #808080;   
border-right: 0px solid #FFFFFF;   
border-top: 0px solid #808080;   
border-bottom: 0px solid #FFFFFF;   
font-family: Verdana, Tahoma, Arial, Helvetica, Sans-serif;   
vertical-align: top;   
background-color: #FFFFCC !IMPORTANT;  

Add similar code in the grid's BeforeShowRow:

  
global $Custom_Data_Definitions;     // grid name  
  
	$current_row_id = $Custom_Data_Definitions->ds->f("custom_data_definition_index");  
  
	$selected_record_id = CCGetParam("cddi",0);  // parameter in URL designating record selected from grid  
  
	global $Tpl;  
	global $tindex;  
	$tindex <= 0 ? $tindex = 1 : $tindex++;  
		{  
		($tindex  % 2) == 1 ? $tclass = "DataTD" : $tclass = "AltDataTD";  
  
		if ( $current_row_id == $selected_record_id )  
			{  
			$tclass = "SelectedDataTD";  
			}  
		else  
			{  
			$tclass = $tclass;  
			}  
		}  
  
	$Tpl->SetVar("tclass",$tclass);  
  
  

Once again, thanks to Dave for the original idea and to Feha for all his help too!!
yelbuga

Posts: 7
Posted: 01/26/2005, 5:00 AM

:-/
non of them works.
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.

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.