csierra
Posts: 123
|
Posted: 09/13/2006, 10:26 PM |
|
Hi there, I am in very real need of a more flexible and capable set of styles wich could make possible, for instance, make a RECORD component implementation to PROGRAMATICALLY build a layout like this
HEADER
label field label field label field
label field label field label field
label field label field label field
label field label field label field
label field label field label field
FOOTER
Instead of only COLUMNAR, and need varous other capabilites such as a different color for the BACKGROUND for the field.value column of the grid containing the record component.
Also, would be nice to make the font size and the border of the textboxes when in adding or editing a record form, if I define a style with a font size of 8pt, only the labels are rendered with that size, the texrboxes are rendered in 10pts no matter what
Please help me to understand and achieve how to do this
Thanks
Carlos
_________________
Yes! I Can!!! |
|
|
Waspman
Posts: 948
|
Posted: 09/14/2006, 12:25 AM |
|
I often re-layout the components of the form once it has been created
and you can change the font size of a text box field although text areas are different.
Go to object properties/ inline styles/edit
Just use the builder as a base and work on that.
T
_________________
http://www.waspmedia.co.uk |
|
|
cab33010
Posts: 26
|
Posted: 09/14/2006, 8:18 PM |
|
Best thing to do is use the Horizontal Grid with MultiExamplePack2 is available for free to registered CCS users.
http://examples.codecharge.com/CCSExamplePack2/Multiple...olumns_desc.php
|
|
|
cHuck
|
Posted: 09/14/2006, 9:13 PM |
|
Rhanks, I´ve seen and studied the provided example, however this example arranges ROWS, 3 in 1; I mean, 3 records per row, what I need is a RECORD component re-layed out to arrange 2 o 3 fields PRORAMATICALLY per row, provided record builder makes one field and its corresponding label per row.. I am studiing how to achieve this modifiying the templates for the Style.ccs files but only get frustration
Any ideas would be very appreciated
Thanks
Carlos
|
|
|
Waspman
Posts: 948
|
Posted: 09/15/2006, 12:53 AM |
|
Sorry thought you were talking about forms.
This is what I use to run grid records horizontal, is this more what you're looking for?
it's somewhere on here but here's the entry;
-----------------------
Several Columns Grid (CCS) - Several Columns Grid (CCS)
Welcome! Login
Contents
Several Columns Grid (CCS)
Article Rating
Current Rating
Total Votes28
Your RatingExtremely HelpfulVery HelpfulHelpfulNot
HelpfulWaste of Time
Several Columns Grid (CCS)
By Elena
Several Columns Grid (CCS)
This article demonstrates how to customize a grid in
CodeCharge Studio so that a certain number of records is
displayed on the same row. The default behavior of a grid
created using tabular layout is to have each record appearing
on its own row within the table. However, there arises cases
when a grid is created to displays a single database field, in
which case it would look awkward to have a single long column
within the table. A more elegant solution would be to display
a number of records on the same row, for instance, 3 records
abreast. This article shows how this can be achieved in
CodeCharge Studio. A similar article but for CodeCharge 2.0 is
located at the address:
http://www.gotocode.com/art.asp?art_id=115&
The example contains ASP and PHP events: Several Columns Grid
project
The main principle of this exercise is the placement of the
<tr></tr> tags that demarcate a row within a HTML table.
Begin by creating a grid form using the Grid Builder and
during the process, opt not to have any sorting or navigation
in the form. Once the form is generated, switch to HTML mode
and remove the table row that contains the field captions:
<table class="PurpleFormTABLE" cellpadding="3">
<!-- you can delete this <tr> tag
<tr>
<td class="PurpleColumnTD" nowrap>Name </td>
</tr> -->
<!-- BEGIN Row -->
<tr>
<td class="PurpleDataTD">{name} </td>
</tr>
<!-- END Row -->
In the next step, replace the <tr> and </tr> tags with two
template variables {open} and {close}:
<!-- BEGIN Row -->
{open}
<td class="PurpleDataTD">{name} </td>
{close}
<!-- END Row -->
The two variables added above will be used to dynamically set
<tr> and </tr> tags after a certain number of records have
been displayed. In this example, the tags will be set after
every 3 records so that each row in the table contains three
columns. In order to achieve this, some code is placed in the
grid's Before Show event to calculate the total number or
records that will be displayed in the entire grid.
ASP
i = 0
rec_count = CCdLookUp("count(*)", "table_name", "1=1",
DBconnection_name)
rec_count = rec_count -1
PHP
global $i;
global $rec_count;
$i = 0;
global $DBAccessConn;
$rec_count = CCDLookUp("count(*)", "languages", "1=1",
$DBAccessConn);
$rec_count --;
Since the i and rec_count variables will be used in two sub
routines, they have to be declared before hand. Place the
declarations at the very top of the PageName_events.asp file
(where PageName is the name of the file), right after the asp
open tag (<%)
ASP only
<%
Dim i
Dim rec_count
'BindEvents Method @1-D49C4645
The main code responsible for setting the <tr> </tr> tags is
located in the grid's Before Show Row event. This event is
executed in a loop for each record that is to be displayed in
the grid.:
ASP
Dim point
if int(i/3) = i/3 then
if i = 0 then
EventCaller.TemplateBlock.Block("Row").Variable("open") =
"<tr>"
else
EventCaller.TemplateBlock.Block("Row").Variable("open") =
"</tr><tr>"
end if
else
EventCaller.TemplateBlock.Block("Row").Variable("open") = ""
end if
if i = rec_count then
EventCaller.TemplateBlock.Block("Row").Variable("close") =
"</tr>"
else
EventCaller.TemplateBlock.Block("Row").Variable("close") = ""
end if
i=i+1
PHP
global $i;
global $rec_count;
global $Tpl;
global $i;
if ((int)($i/3) == $i/3)
{
if ($i == 0)
$Tpl->SetVar("open", "<tr>");
else
$Tpl->SetVar("open", "</tr><tr>");
}
else
$Tpl->SetVar("open", "");
if ($i == $rec_count)
$Tpl->SetVar("close", "</tr>");
else
$Tpl->SetVar("close", "");
$i++;
Unlike the CodeCharge 2.0 implementation, the above code has
an else clause that serves to assign an empty value to the
template variables. CodeCharge Studio “remembers” the values
assigned to template variables in previous iterations so it is
necessary to set a new value otherwise the old one is used.
The last 'if' statement is similar to that used in the
CodeCharge 2.0 implementation. A comparison is made between
the i variable that is sequentially incremented and the
rec_count variable that holds the total number of records to
be displayed. When these two variables are equal, a final
</tr> tag is placed to close the last row in the table.
This site was generated with CodeCharge
_________________
http://www.waspmedia.co.uk |
|
|
csierra
Posts: 123
|
Posted: 09/15/2006, 11:54 PM |
|
Hi there, first, thanks to all of you for making the time & effort to make a suggestion to my dilemma, at this point I've achieved to make my input boxes at 8px font size and borders are not awfully inset anymore! this is achieved by adding the following to your Style.css under styes of the PUBLISHED project:
1. Look for the comment tag 'Record' ( /* Record Options */ )
2. Add the following:
.Controls Input {
font-size: 8pt; font-family: Arial;
padding: 1px;
border-right: 1px solid #FFFFFF;
color: #FF0000;
vertical-align: top;
background-color: #f7f7f7;
}
3. That´s it!
Please be aware that each time you publish CCS may overwrite this so if you want, then make this changes on your Style.css under your codecharge installation folder/.../Styles/Style.css but be careful since this is modifiying your original CCS setup
The thing I am triying now to achieve is to get an AltColumn (or kind of) to make a 4 column layout for my read only records) but only frustration! any ideas would be great
Carlos
_________________
Yes! I Can!!! |
|
|
csierra
Posts: 123
|
Posted: 09/16/2006, 12:22 AM |
|
Hi there, I've come to a workout for my AltCol request, make a common Record with the record builder, I use many read-only (only labels on it, no update, no insert and so) and make it with a COLUMNAR layout, then manually insert another 2 columns and then goto html code and change by hand the td with a th tag for EVERY OTHER column, after doing so and properly change the background attribute for that tag in the so mentioned Style.css you have a multicolumn record component implementation showing a different background color for the field names column and another color for the field values column!
Hope find this helpfull, and another thing I´ve found when learning, try this
http://www.cssbasics.com/
Pretty good, this site brought to my ming another question, is it possible to define a general layout in an HTML template with a general layout.css applyed to this template? if so, for instance I define 4 mayor zones or areas to work with my newpage's canvas, how can I assing my builder's wizards resulting components to get into this areas since are those defined in the layout.css and not in the html tags?
_________________
Yes! I Can!!! |
|
|
Waspman
Posts: 948
|
Posted: 09/16/2006, 1:42 AM |
|
It is forms/records your talking about.
I just make table/layout mods and drag the components to where I want them.
I alter the object 's style in the custom edit then I don't have to worry about publishing issues.
Ain't CCS great!
_________________
http://www.waspmedia.co.uk |
|
|
|